Comment

Peter Bengtsson

This fails on floating point numbers. isInt("1.1") is false but isInt("1.0") is true which it's not supposed to.

Parent comment

scott christopher

I tend to use: function isInt (i) { return (i % 1) == 0; }