⬅︎ Back to isInt() JavaScript function
Python does the same:>>> 3.0 == 3TrueBut in python you can do:>>> 3 is 3True>>> 3.0 is 3.0True>>> 3.0 is 3False
Why this: var n = 3.0; alert(parseInt(n)===n); alerts "true"?
Comment
Python does the same:
>>> 3.0 == 3
True
But in python you can do:
>>> 3 is 3
True
>>> 3.0 is 3.0
True
>>> 3.0 is 3
False
Parent comment
Why this: var n = 3.0; alert(parseInt(n)===n); alerts "true"?