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.
Truman
6 months agoAnnabelle
5 months agoHalina
6 months agoYan
6 months agoDorsey
6 months agoLoren
5 months agoAnnamae
6 months agoSimona
6 months agoTiera
6 months agoLera
6 months agoTiera
6 months agoLavonda
6 months agoRasheeda
6 months agoAvery
6 months agoErick
7 months agoShoshana
7 months agoDean
7 months agoLarae
7 months agoLarae
7 months agoJeanice
7 months agoBrock
7 months agoCortney
6 months agoLatosha
6 months agoErick
7 months agoShoshana
7 months agoIlene
8 months agoReita
8 months agoBernardo
8 months agoEzekiel
8 months agoRolland
8 months agoBeckie
8 months agoAracelis
7 months agoNorah
7 months agoIrene
7 months ago