Pre-Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: validbest

Exam JavaScript-Developer-I All Questions
Exam JavaScript-Developer-I All Questions

View all questions & answers for the JavaScript-Developer-I exam

Salesforce Developer JavaScript-Developer-I Question # 43 Topic 5 Discussion

JavaScript-Developer-I Exam Topic 5 Question 43 Discussion:
Question #: 43
Topic #: 5

Refer to the following code:

01 function Tiger(){

02this.Type = ‘Cat’;

03 this.size = ‘large’;

04 }

05

06 let tony = new Tiger();

07 tony.roar = () =>{

08 console.log(‘They\’regreat1’);

09 };

10

11 function Lion(){

12 this.type = ‘Cat’;

13 this.size = ‘large’;

14 }

15

16 let leo = new Lion();

17 //Insertcode here

18 leo.roar();

Which two statements could be inserted at line 17 to enable the function call on line 18?

Choose 2 answers.


A.

Leo.roar = () => { console.log(‘They\’re pretty good:’); };


B.

Object.assign(leo,Tiger);


C.

Object.assign(leo,tony);


D.

Leo.prototype.roar = () => { console.log(‘They\’re pretty good:’); };


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.