Home » JavaScript » JavaScript Functions » Question
  1. Consider the following code snippet :
    var string2Number=parseInt("456pqr");
    1. 456pqr
    2. Exception
    3. NaN
    4. 456
    5. None of these
Correct Option: D

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



Your comments will be displayed only after manual approval.