What is the purpose of a return statement in a function?
Returns the value and continues executing rest of the statements, if any
Returns the value and stops the program
Returns the value and stops executing the function
Stops executing the function and returns the value
Answer : D
View More Related Question
1) The function definitions in JavaScript begins with
Identifier and Parantheses
Return type and Identifier
Return type, Function keyword, Identifier and Parantheses
Identifier and Return type
View Answer
2) Consider the following code snippet
function printprops(o)
{
for(var p in o)
console.log(p + ": " + o[p] + "\n");
}
What will the above code snippet result ?
Prints the contents of each property of o
Returns undefined
All of the mentioned
None of the mentioned
View Answer
3) Which is an equivalent code to invoke a function m of class o that expects two arguments x and y?
4) Consider the following code snippet :
var string2Num=parseInt("123xyz");
The result for the above code snippet would be :
5) When does the function name become optional in JavaScript?
When the function is defined as a looping statement
When the function is defined as expressions
When the function is predefined
All of the mentioned
View Answer