Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 24 Topic 3 Discussion

Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 24 Topic 3 Discussion

JavaScript-Developer-I Exam Topic 3 Question 24 Discussion:
Question #: 24
Topic #: 3

Refer tofollowing 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;


Get Premium JavaScript-Developer-I Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.