Skip to content

Instantly share code, notes, and snippets.

@woliveiras
Last active August 30, 2020 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save woliveiras/63918f4725b91bf3f6e484cdae462c96 to your computer and use it in GitHub Desktop.
Save woliveiras/63918f4725b91bf3f6e484cdae462c96 to your computer and use it in GitHub Desktop.
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