Consider the following code snippet :
var string2Num=parseInt("123xyz
Home | Discussion Forum
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) If you have a function f and an object o, you can define a method named m of o with
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) 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
4) 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
5) Consider the following code snippet
function hypotenuse(a, b)
{
function square(x)
{
return x*x;
}
return Math.sqrt(square(a) + square(b));
}
What does the above code result?
Sum of square of a and b
Square of sum of a and b
Sum of a and b square
None of the mentioned
View Answer