archives

« Bugzilla Issues Index

#1585 — Should parseInt handle octal and binary integer literals


Currently parseInt handles 0x as Hex. Should it handle 0b as binary? and 0o as octal?


I was about to file this and found the dup, so bumping the revision number


WONTFIX as per April 9 TC39 meeting.

It’s a compatibility risk — both `parseInt('0b11')` and `parseInt('0o42')` return `0` in ES5. Use `Number('0b11')` and `Number('0o42')` instead.