2 ms·
> parseInt("012") Modern browsers will say 12, old browsers (IE 8 and down) will say 10.
by kybernetikos 7y ago
> parseInt("012")
Modern browsers will say 12, old browsers (IE 8 and down) will say 10.
- sammorrowdrums 7y agoGreat example, I guess I forgot that a few changes were made that otherwise did surprising things. They also changed to (at least more) deterministic ordering of object keys and I wonder how much code worked
- sammorrowdrums 7y agoGreat example, I guess I forgot that a few changes were made that otherwise did surprising things. They also changed to a (more) deterministic ordering of object keys and I wonder how much software behaved differently / broke as a consequence... My "favourite" JS quirk is some of the IE versions where it would break if you called console.log without the console open, as it was undefined. So many quirks, I think I may have slightly overstated the compatibility element.