Skip to content

Instantly share code, notes, and snippets.

@ktrysmt
Created October 5, 2016 07:58
Show Gist options
  • Save ktrysmt/5bf6aee5d6a049b32cb01e15b042e1eb to your computer and use it in GitHub Desktop.
Save ktrysmt/5bf6aee5d6a049b32cb01e15b042e1eb to your computer and use it in GitHub Desktop.
A simple snippet How to use es6 generator.
function* f() {
yield 9
yield 'home'
yield 'do not miss it!'
}
var bind = f()
console.log(bind.next(),bind.next(),bind.next(),bind.next())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment