3 ms·
Actually, in the old days a string number with a leading 0 in javascript got parsed as an octal. You used to have to do parseInt('0012345', 10) to get it to par
by mattmanser 4y ago
Actually, in the old days a string number with a leading 0 in javascript got parsed as an octal. You used to have to do parseInt('0012345', 10) to get it to parse properly.
That's what I assume the GP is referring to.
They changed it in ECMAScript 5.
More details here:
https://eslint.org/docs/latest/rules/radix https://eslint.org/docs/latest/rules/radix
- sdf4j 4y agoFaced a similar issue in Java. Someone decided it was a good idea to convert string postal codes to int. For sorting... Using Integer.decode()... Everything was ok until a "09677" show up.