Hacker News new | ask | show | jobs
by mseepgood 1219 days ago
Octal is sneakier than hexadecimal, especially if the values are from user input.

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

2 comments

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]