in JavaScript by
What output will come if we run the following part of the JavaScript code?

a) var string2Num=parseInt("123abc");  

b) Exception

c) 123abc

d) 123

e) NaN

► Click here to show 1 Answer

0 votes

Answer: C

Reason: The "parseIn()" is a pre-defined method of the JavaScript that parses a string, and as a result, it returns an integer. It also returns the first digit as 0 if the string does not contain an integer in the first place.

Learn More with Madanswer