Q. Consider the following code snippet :
var string2Num=parseInt("123xyz");
The result for the above code snippet would be :
var string2Num=parseInt("123xyz");
The result for the above code snippet would be :
β
Correct Answer: (B)
123xyz
Explanation: The parseInt() function returns the first integer contained in the string or 0 if the string does not begin with an integer.