Do functions in JavaScript necessarily return a value ?
It is mandatory
Not necessary
Few functions return values by default
All of the mentioned
Answer : C
View More Related Question
1) Consider the following code snippet :
var grand_Total=eval("10*10+5");
The output for the above statement would be :
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 :
var c = counter(), d = counter();
c.count()
d.count()
c.reset()
c.count()
d.count()
The state stored in d is :
4) 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
5) For the below mentioned code snippet:
var o = new Object();
The equivalent statement is: