1.

What will happen if a return statement does not have an associated expression?(a) It returns the value 0(b) It will throw an exception(c) It returns the undefined value(d) It will throw an errorI got this question in examination.This intriguing question comes from Defining and Invoking Functions in chapter Lexical Structures of JavaScript

Answer»

Correct choice is (c) It returns the UNDEFINED VALUE

For explanation: A function without a return STATEMENT will return a default value. If the return statement does not have an ASSOCIATED expression then it returns an undefined value.



Discussion

No Comment Found

Related InterviewSolutions