Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the equivalent statement of the following JavaScript statement?
var o = new Object();

What will be the equivalent statement of the following JavaScript statement?
var o = new Object();
a) var o = Object();
b) var o;
c) var o= new Object;
d) Object o=new Object();

Answer: c
Explanation: As a special case, for the new operator only, JavaScript simplifies the grammar by allowing the parenthesis to be omitted if there are no arguments in the function call. Hence you can always omit a pair of empty parentheses in a constructor invocation.

Join The Discussion