Hacker News new | ask | show | jobs
by jakear 1219 days ago
Also, no reason to write extra characters just to prevent people from using hexadecimal, it's often convenient and it comes for free!
1 comments

Octal is sneakier than hexadecimal, especially if the values are from user input.

['07', '08', '09'].map(val => parseInt(val)) // => [7, 0, 0]

Plus there's this if you really want to support old browsers: https://github.com/zloirock/core-js/blob/ce52fdc735c5c809c9e...
was

['07', '08', '09'].map(val => parseInt(val)) // => [7, 8, 9]