Question 51

Refer to the following code:
class Vehicle{
constructor(plate){
this.plate = plate;
}
}
class Truck extends Vehicle{
constructor(plate, weight){
//Missing code
this.weight = weight;
}
displayWeight(){
console.log(`The truck ${this.plate} has a weight of ${this.weight}lb.`);
}
}let myTruck = new Truck('123Ab',5000);
myTruck.displayWeight();
Which statement should be added to missing code for the code to display 'The truck 123AB has a weight of 5000lb.
  • Question 52

    What are two unique features of functions defined with a fat arrow as compared to normal function definition?
    Choose 2 answers
  • Question 53

    Refer to the code below:
    Let foodMenu1 = ['pizza', 'burger', 'French fries'];
    Let finalMenu = foodMenu1;
    finalMenu.push('Garlic bread');
    What is the value of foodMenu1 after the code executes?
  • Question 54

    Refer to the code below:
    function changeValue(param) {
    Param =5;
    }
    Let a =10;
    Let b =5;
    changeValue(b);
    Const result = a+ " - "+ b;
    What is the value of result when code executes?
  • Question 55

    Which three statements are true about promises ?
    Choose 3 answers