Why does isNaN(123.) return false?

Posted by vivekraman on Stack Overflow See other posts from Stack Overflow or by vivekraman
Published on 2010-06-10T05:10:56Z Indexed on 2010/06/10 5:12 UTC
Read the original article Hit count: 161

Hi,

Why does the Javascript function call isNaN(123.) return false? Is this a universally acceptable number or will it cause errors downstream?

I'm validating whether a value is a valid decimal using isNaN along with split. Are there cross-browser issues with isNaN? Should I use a bespoke implementation?

Thanks.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about validation