Skip to content

Instantly share code, notes, and snippets.

@cesarkohl
Last active January 13, 2020 14:36
Show Gist options
  • Select an option

  • Save cesarkohl/e9c76bddcb372b74e8774483caa786ad to your computer and use it in GitHub Desktop.

Select an option

Save cesarkohl/e9c76bddcb372b74e8774483caa786ad to your computer and use it in GitHub Desktop.
var witches = ['Harry Potter', 'Hermione Granger', 'Ron Weasley'];
// get the iterator
var iteratorWitches = witches [Symbol.iterator] ();
iteratorWow.next (); // {value: Harry Potter, done: false}
iteratorWow.next (); // {value: Hermione Granger, done: false}
iteratorWow.next (); // {value: Ron Weasley, done: false}
iteratorWow.next (); // {value: undefined, done: true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment