-
Notifications
You must be signed in to change notification settings - Fork 13
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
Iterating on the API Design #19
Comments
See also, array.build |
It is possible to move to |
It is viable to implement a
|
There is an issue with one of the suggestions that I made here (2020 eh) -- Iterator doesn't exist in the language as a builtin. I think the intention here was on the iterator prototype? That said in our current discussion we are not against Number.range() etc. |
The Iterator Helpers proposal exposes it as a global. |
Now we throw for non-number/bigint inputs for Iterator.range, which leaves future space if we want to support other data types.
Yes, that's possible for other languages like Swift or Rust, but in JavaScript, we don't have I'm closing this issue for housekeeping, but still welcome discussion! |
One thing that stands out to us is that this is being implemented per number type. We are wondering what the use case would be for bignumber, or indeed for bigDecimal. Perhaps rather than having this as a method on number types, this can live somewhere else. One suggestion was to provide a
NumberRangeIterator
and if necessary aBigIntRangeIterator
. Another thought was that this isn’t really about numbers, but about producing lists. So in this case it might make sense as a method on array, on Iterator, or something similar. We think that this can be made clearer by a better understanding of the use cases for this.The text was updated successfully, but these errors were encountered: