1.

A function definition expression can be called as __________(a) Function prototype(b) Function literal(c) Function calling(d) Function declarationThe question was posed to me in an online interview.This interesting question is from Expressions and Operators topic in section Lexical Structures of JavaScript

Answer»

The correct choice is (B) Function literal

Explanation: A function definition expression is a “function literal” in the same way that an object initializer is an “object literal.” A Function definition expression typically consists of the keyword function FOLLOWED by a comma-separated LIST of ZERO or more IDENTIFIERS (the parameter names) in parentheses and a block of JavaScript code (the function body) in curly braces.



Discussion

No Comment Found

Related InterviewSolutions