List of questions
Related questions
Question 106 - Certified JavaScript Developer I discussion
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;
Your answer:
0 comments
Sorted by
Leave a comment first