A

Admin • 833K Points
Coach

Q. Will the following JavaScript code work?

Code:
var js = (function(x) {return x*x;}(10));
  • (A) Exception will be thrown
  • (B) Memory leak
  • (C) Error
  • (D) Yes, perfectly
  • Correct Answer - Option(D)
  • Views: 22
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

For functions expressed as expressions, the function name is optional in Javascript. Sometimes function expressions are defined and used right away.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.