Skip to content

Instantly share code, notes, and snippets.

@Ibro Ibro/iterators-string.js
Last active Apr 26, 2017

Embed
What would you like to do?
Iterators - string - Coding Blast - www.codingblast.com
let someText = 'code';
let iterator = someText[Symbol.iterator]();
console.log(iterator.next()); // { value: "c", done: false }
console.log(iterator.next()); // { value: "o", done: false }
console.log(iterator.next()); // { value: "d", done: false }
console.log(iterator.next()); // { value: "e", done: false }
console.log(iterator.next()); // { value: undefined, done: true }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.