Consider the following code snippet :
var string2Num=parseInt("123xyz");
The result for the above code snippet would be :
123
123xyz
Exception
NaN
Answer : B
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) A function with no return value is called
3) 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
4) Consider the following code snippet :
function constfuncs()
{
var funcs = [];
for(var i = 0; i < 10; i++)
funcs[i] = function()
{
return i;
};
return funcs; }
var funcs = constfuncs();
funcs[5]()
What does the last statement return ?
5) 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