3 ms·
Always give the base to parseInt in Javascript. Always. The moment you don't, all kinds of bugs follow. I have to go cry now at the number of times this has
by bsder 13y ago
Always give the base to parseInt in Javascript.
Always. The moment you don't, all kinds of bugs follow.
I have to go cry now at the number of times this has bitten me.
- TazeTSchnitzel 13y agoAre there any other problems aside from octal?
- ajanuary 13y agoNot just javascript, a whole bunch of language's parseInt implementation will interpret the base from a leading zero etc.