Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  9] [ 1]  / answers: 1 / hits: 15154  / 13 Years ago, fri, november 25, 2011, 12:00:00

There is something strange.



Why

with isNaN() I get False

But

with parseInt() I get NaN

?


More From » javascript

 Answers
2

isNaN takes an integer as an argument - therefore JS converts to 0



parseInt takes a string as an argument - therefore an empty string is not a number


[#88907] Wednesday, November 23, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tyreek

Total Points: 421
Total Questions: 115
Total Answers: 102

Location: Marshall Islands
Member since Mon, May 31, 2021
3 Years ago
;