News for hackers. Stuff that matters.
Re:Be careful with JS numbers by VMG on Sunday January 13, 2013 @04:33PM (#5051938)
you can also just use Number() to be safe
Re:Be careful with JS numbers by gren on Sunday January 13, 2013 @04:52PM (#5052019)
How is it different?
Re:Be careful with JS numbers by Hovertruck on Sunday January 13, 2013 @06:00PM (#5052256)
Think of parseInt() as what it says- parsing out the number value. Number() can be considered as a cast.

    parseInt('12', 10);  => 12
    Number('12');        => 12
    parseInt('12x', 10); => 12
    Number('12x');       => NaN