-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add 'range(start, end, step)' iterator function to be used with for loop #1535
Comments
Please see https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md#creating-a-new-proposal for how to best suggest new features for the language. For some prior art, see http://array.build, and |
@Ijharb, thanks for letting me know. |
|
Agree. Hope this is implemented into JavaScript in the future. |
@EdSaleh To be clear, generators are already a part of JavaScript, and are implemented in every browser except Internet Explorer. You don't need to wait for anything, you can use it today. |
Yes, I know. I'm talking about the range() method to be built-in into JavaScript. |
@ljharb Perhaps the template for a feature request (when you submit an issue to this repo) could direct people to esdiscuss.org? That seems like the best "first step" for people who are interested in proposing a new feature. https://esdiscuss.org/topic/new-proposal-number-range-yes-range-again https://github.com/Jack-Works/proposal-Number.range tc39/proposal-slice-notation#19 (comment) That last one looks pretty neat. |
Hello,
I am proposing the addition of
range(start, end, step=1)
iterator function.This function would make creating for loops easy and follow the trend going on with other programming languages replacing
for(;;)
style.Example:
Current way of declaring for loop:
New way with
range
iterator function:Thank You,
The text was updated successfully, but these errors were encountered: