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.

Will the following JavaScript code work?
var tensquared = (function(x) {return x*x;}(10));

Will the following JavaScript code work?
var tensquared = (function(x) {return x*x;}(10));
a) Yes, perfectly
b) error
c) Exception will be thrown
d) Memory leak

Answer: a
Explanation: Function name is optional for functions defined as expressions. Function expressions are sometimes defined and immediately invoked.

Join The Discussion