News for hackers. Stuff that matters.
Re:A re-introduction to JavaScript by hajile on Saturday May 09, 2015 @07:14PM (#9518039)
Number() also converts to NaN if it's not a number though I would still avoid the + operator here because it is code smell (looks like you forgot your variable to concat).

Number automatically accepts exponent notation and auto-converts to hex (ignoring octal). parseInt() auto-converts hex and octal unless a radix is specified, but it also ignores the remaining non-number characters at the end of the string.

There isn't a single method that does whatever you want.

There are no comments on this comment yet.