Skip to content

Instantly share code, notes, and snippets.

@Ibro Ibro/iterators-array.js

Last active Apr 26, 2017
What would you like to do?
JavaScript Iterators - Array - Coding Blast -
let numbers = [1, 2, 3];
let it = numbers[Symbol.iterator]();
console.log(; // {value: 1, done: false}
console.log(; // {value: 2, done: false}
console.log(; // {value: 3, done: false}
console.log(; // {value: undefined, done: true}
for (let num of numbers) {
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.