What will be the output of the following JavaScript code? [code] var o = new F(); o.constructor === F [/code]

Trang Esther

New member
What will be the output of the following JavaScript code?
Code:
var o = new F();
o.constructor === F
A. false
B. true
C. 0
D. 1
 
Answer: b
Explanation: Constructor is a function property of the class which is used to create objects of that class. In the above code, both statements create an instance of the class.
 

Tìm kiếm

Back
Top