Last active
August 30, 2020 20:45
-
-
Save woliveiras/63918f4725b91bf3f6e484cdae462c96 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* generatorFunction(){ | |
var index = 0; | |
while(true) | |
yield index++; | |
} | |
let myIterator = generatorFunction(); | |
console.log(myIterator) | |
/* | |
generatorFunction | |
__proto__ : Generator | |
[[GeneratorStatus]] : "suspended" | |
[[GeneratorFunction]] : generatorFunction() | |
[[GeneratorReceiver]] : Window | |
[[GeneratorLocation]] : VM133:1 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment