Q22
Consider the following code snippet : var tensquared = (function(x) return x*x;(10)); Will the above code work ?
A.
Yes, perfectly
AnswerB.
Error
C.
Exception will be thrown
D.
Memory leak
Answer: Option A
Solution
Answer: Option A
Solution:
Function name is optional for functions defined as expressions. Function expressions are sometimes defined and immediately invoked.