3 ms·
Sorry if I expressed myself poorly but that is exactly the point I wanted to make. To maintain backward compatibility, new constructs with partial overlap with
by pythux 7y ago
Sorry if I expressed myself poorly but that is exactly the point I wanted to make. To maintain backward compatibility, new constructs with partial overlap with existing ones are introduced; and this overall increases the complexity of the language. Whereas breaking backward compatibility would allow to re-use existing constructs and change their semantics (I am not saying this would be a better path though).
- 11235813213455 7y agoFor example there are 3 String methods to take a substring (substring, substr, slice) (there's even 4th way in proposal: https://github.com/tc39/proposal-slice-notation https://github.com/tc39/proposal-slice-notation) The last added one is slice, and actually simplifies things, with its consistency with Array.prototype.slice, and replace the old ones I agree it's annoying to keep old methods for backward-comptibility