Question 16

Refer to 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 line 09 for the code to display 'The truck 123AB has a
weight of 5000lb.'?
  • Question 17

    Refer to the code below:
    Const pi = 3.1415326,
    What is the data type of pi?
  • Question 18

    Considering the implications of 'use strict' on line 04, which three statements describe the execution of the code?
    Choose 3 answers
  • Question 19

    Refer to the code below:

    What is display when the cod executes?
  • Question 20

    Refer to code below:
    function Person() {
    this.firstName = 'John';
    }
    Person.prototype ={
    Job: x => 'Developer'
    };
    const myFather = new Person();
    const result =myFather.firstName + ' ' + myFather.job();
    What is the value of the result after line 10 executes?