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

Refer to the following code:

01 function Tiger(){

02this.Type = ‘Cat’;

03 this.size = ‘large’;

4 }

5

6 let tony = new Tiger();

7 tony.roar = () =>{

8 console.log(‘They’re great1’);

9 };

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:’); };

Answer: A,C

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments