1.

When does the function name become optional in JavaScript?(a) When the function is defined as a looping statement(b) When the function is defined as expressions(c) When the function is predefined(d) when the function is calledI have been asked this question in quiz.I'm obligated to ask this question of Defining and Invoking Functions in section Lexical Structures of JavaScript

Answer»

Correct OPTION is (b) When the FUNCTION is defined as EXPRESSIONS

Easy EXPLANATION: The function name is optional for functions defined as expressions. A function declaration statement actually declares a variable and assigns a function object to it.



Discussion

No Comment Found

Related InterviewSolutions