Skip to content

Instantly share code, notes, and snippets.

@leonardreidy
Last active September 27, 2019 11:36
Show Gist options
  • Save leonardreidy/427a5bdb66482dc16116eeb7a5b1c19e to your computer and use it in GitHub Desktop.
Save leonardreidy/427a5bdb66482dc16116eeb7a5b1c19e to your computer and use it in GitHub Desktop.
// An object that respects the iterable protocol
var anIterableObject = {
[Symbol.iterator]: function(){ return something }
};
// An object that respects the iterator protocol and the iterable protocol
var anIterableIterator = {
next: function() { return {value: somevalue, done: trueorfalse },
[Symbol.iterator]: function(){ return something }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment