Created
March 11, 2026 06:22
-
-
Save marcingolenia/a38a7649faa3407beba625b2b0115848 to your computer and use it in GitHub Desktop.
JS number array Generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Number.prototype[Symbol.iterator] = function* () { | |
| for (let i=0; i < this; i++) { | |
| yield i; | |
| } | |
| } | |
| //and then: | |
| [...1000] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment