Examveda
Examveda

Consider the following code snippet :
var string2Num=parseInt("123xyz");
The result for the above code snippet would be :

A. 123

B. 123xyz

C. Exception

D. NaN

Answer: Option B

Solution(By Examveda Team)

The parseInt() function returns the first integer contained in the string or 0 if the string does not begin with an integer.

This Question Belongs to Javascript >> Array And Function

Join The Discussion

Comments ( 1 )

  1. Mounika Karikati
    Mounika Karikati :
    3 years ago

    what is the output of parseInt(123xy); ?

Related Questions on Array and Function