Created
July 24, 2019 22:22
-
-
Save todgru/58c020d2f9490251da3ffe7358fa693c 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
const arr = [1, 2, 3, 4, 5, 6]; | |
const iter = arr[Symbol.iterator](); | |
const foo = i => { | |
const v = i.next(); | |
if (v.done) return "done!"; | |
console.log("next!", v.value); | |
return foo(i); | |
}; | |
foo(iter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment