New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strings **should** be considered as iterables #244
Comments
Furthermore, Iterator.from(Object('abc')); // => StringIterator But from ES2015 the behavior of non-modifying methods that can work with primitive wrappers, but can't work with primitives, was changed to accepting primitives, like: Object.getPrototypeOf('abc'); // => String.prototype (from ES2015) |
How do you think I think we've made the most practical choice here. And the committee usually sides with practicality over consistency. But I was already planning to bring up this decision during the presentation to committee: see item 3.b in this slide. |
I personally would prefer |
I'm sure that it's not the most practical choice - inconsistency with the rest cases and breaking the iterables protocol is a more dangerous potential footgun. I think that However, I'm OK if |
With #233, strings are not considered as iterables. It's complete nonsense.
WTF? Yes, making strings iterable was a controversial decision - but since they are already iterable and it's not possible to change it - maybe it's better to stop break the language by adding inconsistencies?
The text was updated successfully, but these errors were encountered: