Refer to following code: class Vehicle { constructor(plate) { This.

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.’?
A. Super.plate =plate;
B. super(plate);
C. This.plate =plate;
D. Vehicle.plate = plate;

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.