ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 76 - Certified JavaScript Developer I discussion

Report
Export

A developer wants to create an object from a function in the browser using the code below:

Function Monster() { this.name = 'hello' };

Const z = Monster();

What happens due to lack of the new keyword on line 02?

A.
The z variable is assigned the correct object.
Answers
A.
The z variable is assigned the correct object.
B.
The z variable is assigned the correct object but this.name remains undefined.
Answers
B.
The z variable is assigned the correct object but this.name remains undefined.
C.
Window.name is assigned to 'hello' and the variable z remains undefined.
Answers
C.
Window.name is assigned to 'hello' and the variable z remains undefined.
D.
Window.m is assigned the correct object.
Answers
D.
Window.m is assigned the correct object.
Suggested answer: C
asked 23/09/2024
Andre van Mierlo
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first