Skip to content

Instantly share code, notes, and snippets.

@SimonRichardson
Created September 3, 2013 09:20
Show Gist options
  • Select an option

  • Save SimonRichardson/6421537 to your computer and use it in GitHub Desktop.

Select an option

Save SimonRichardson/6421537 to your computer and use it in GitHub Desktop.
Generators in javascript
function* create() {
for(var i = 0; i < 10; i++) {
yield i;
}
}
var gen = create();
console.log(gen.next());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment