Notifications
Clear all

Refer to the following code:

1 Posts
1 Users
0 Likes
92 Views
(@pesterfieldrayford)
Posts: 681
Noble Member
Topic starter
 

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.

  • A . super(plate)
    B. super.plate = plate
    C. Vehicle.plate = plate
    D. this.plate = plate

Show Answer Hide Answer

Suggested Answer: A
 
Posted : 01/02/2023 6:35 am

Latest Salesforce JavaScript Developer I Dumps Valid Version

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Share: