ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 136 - 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 Option B?

A.
1 growl method is created for Option A. 1000 growl methods are created for Option B.
Answers
A.
1 growl method is created for Option A. 1000 growl methods are created for Option B.
B.
1000 growl method is created for Option A. 1 growl methods are created for Option B.
Answers
B.
1000 growl method is created for Option A. 1 growl methods are created for Option B.
C.
1000 growl methods are created regardless of which option is used.
Answers
C.
1000 growl methods are created regardless of which option is used.
D.
1 growl method is created regardless of which option is used.
Answers
D.
1 growl method is created regardless of which option is used.
Suggested answer: B
asked 23/09/2024
Mia Mattsson
45 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first