Home » JavaScript » JavaScript Functions » Question
  1. Consider the following code snippet :
    var tensquared = (function(n) {return n*n;}(100));

    Will the above code work ?
    1. Memory leak
    2. Exception will be thrown
    3. Error
    4. Yes
    5. None of these
Correct Option: D

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



Your comments will be displayed only after manual approval.