Q. Consider the following code snippet :
var tensquared = (function(x) {return x*x;}(10));
Will the above code work ?
var tensquared = (function(x) {return x*x;}(10));
Will the above code work ?
β
Correct Answer: (A)
Yes, perfectly
Explanation: Function name is optional for functions defined as expressions. Function expressions are sometimes defined and immediately invoked.