What is the purpose of a return statement in a function?
Home | Discussion ForumWhat 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) 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
View Answer
2) Consider the following code snippet
function f() {};
The above prototype represents a
3) 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
4) If you have a function f and an object o, you can define a method named m of o with
5) Consider the following code snippet
o.m(x,y);
Which is an equivalent code for the above code snippet?