3 ms·
Actually, I'd argue that the former is also because of backward compatibility: if it wasn't, it would be easy to treat all literal integers as Integers and ever
by BerislavLopac 9y ago
Actually, I'd argue that the former is also because of backward compatibility: if it wasn't, it would be easy to treat all literal integers as Integers and everything else as Numbers, similarly to what exists in Python.
I would dare say that even with this approach it would be possible to maintain backward compatibility with smart conversion, although I'm not familiar enough with ES internals to be more decided on that.
- hdhzy 9y agoPersonally I think JavaScript is already full of "smart" conversions and the trend now is to make new things simple instead of fueling XXI century's WTF.js (see http://brian.io/slides/dotjs-2012/ http://brian.io/slides/dotjs-2012/ ).