Skip to content

Instantly share code, notes, and snippets.

@hk-skit
Created January 27, 2019 10:20
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 hk-skit/7c5c06eb6e2a285959fdc26a687a8fbb to your computer and use it in GitHub Desktop.
Save hk-skit/7c5c06eb6e2a285959fdc26a687a8fbb to your computer and use it in GitHub Desktop.
// Generator function.
*[Symbol.iterator]() {
let current = this.head;
while (current !== null) {
const { value } = current;
current = current.next;
yield value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment