ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 213 - Certified JavaScript Developer I discussion

Report
Export

A developer has two ways to write a function:

Option A:

function Monster(){

this.growl = ()=>{

console.log('Grr!');

}}

Option B:

function Monster(){};

Monster.prototype.growl = ()=>{

console.log('Grr!');

}

After deciding on an option, the developer creates 1000 monster objects.

How many growl methods are created with Option A and Option B?

A.
1000 for Option A, 1 for Option B
Answers
A.
1000 for Option A, 1 for Option B
B.
1 methods for both
Answers
B.
1 methods for both
C.
1000 for both
Answers
C.
1000 for both
D.
1 for Option A, 1000 for Option B
Answers
D.
1 for Option A, 1000 for Option B
Suggested answer: B
asked 23/09/2024
Ricardo Andres
30 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first