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
Answer : B
View More Related Question
1) What will happen if a return statement does not have an associated expression?
It returns the value 0
It returns the value 0
It returns the undefined value
None of the mentioned
View Answer
2) What is the difference between the two lines given below ? !!(obj1 && obj2); (obj1 && obj2);
Both the lines result in a boolean value “True”
Both the lines result in a boolean value “False”
Both the lines checks just for the existence of the object alone
The first line results in a real boolean value whereas the second line merely checks for the existence of the objects
View Answer
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) Consider the following code snippet :
var tensquared = (function(x)
{
return x*x;
}
(10));
Will the above code work ?
5) A function with no return value is called