Skip to content

Instantly share code, notes, and snippets.

@past
Created May 28, 2013 21:55
Show Gist options
  • Save past/5666483 to your computer and use it in GitHub Desktop.
Save past/5666483 to your computer and use it in GitHub Desktop.
function Foo() {}
Foo.prototype.iterator = function() {
// yield 1;
// throw StopIteration;
}
var f = new Foo();
console.log([i for (i of f)]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment