Re:<3 Deno
by jakear on Sunday February 12, 2023 @07:49PM
(#34768848)
Also, no reason to write extra characters just to prevent people from using hexadecimal, it's often convenient and it comes for free!
[ Parent
| on HN ]
Octal is more sneaky than hexadecimal, especially if the values are from user input.
['07', '08', '09'].map(val => parseInt(val)) // => [7, 0, 0]
was
['07', '08', '09'].map(val => parseInt(val)) // => [7, 8, 9]
Hasn't been an issue in around a decade: https://developer.mozilla.org/en-US/docs/web/javascript/refe...
Plus there's this if you really want to support old browsers: https://github.com/zloirock/core-js/blob/ce52fdc735c5c809c9e...