Created
April 10, 2020 01:11
-
-
Save copperwall/2246b745ad8494734eded70ff3fe1c56 to your computer and use it in GitHub Desktop.
This file contains 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
function *range(min, max) { | |
while (min < max) { | |
yield min | |
min += 1 | |
} | |
} | |
// Doesn't run out of memory | |
for (const num of range(1, 1000000000000000000)) { | |
console.log(num) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment