0 votes
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

1 Answer

0 votes
by

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.

Related questions

+1 vote
asked Mar 22, 2021 in JavaScript by Robindeniel
0 votes
asked Mar 24, 2021 in JavaScript by sharadyadav1986
...