Skip to content

Instantly share code, notes, and snippets.

@chrisbuttery
Created January 11, 2015 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisbuttery/6fc62d61de7bc65b8bef to your computer and use it in GitHub Desktop.
Save chrisbuttery/6fc62d61de7bc65b8bef to your computer and use it in GitHub Desktop.
generatorz
function *write(){
console.log('writing');
var num = yield 1;
console.log('num x num =', num * num);
}
function *blah () {
console.log('starting blah');
yield* write();
console.log('ending blah');
}
var it = blah();
it.next();
it.next(9);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment