A

Admin • 833K Points
Coach

Q. Consider the following code snippet :
var tensquared = (function(x) {return x*x;}(10));
Will the above code work ?

  • (A) Yes, perfectly
  • (B) Error
  • (C) Exception will be thrown
  • (D) Memory leak
  • Correct Answer - Option(A)
  • Views: 23
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

Function name is optional for functions defined as expressions. Function expressions are sometimes defined and immediately invoked.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.