Last active
October 29, 2018 07:47
-
-
Save ltciro/adc5f47667d24ac5086d9f83b18e2393 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arr = [1,2,4][Symbol.iterator]() | |
console.log('Next in array_as_iterable 1', arr.next()) | |
// Next in array_as_iterable 1 | |
// {value: 1, done: false } | |
console.log('Next in array_as_iterable 2', arr.next()) | |
// Next in array_as_iterable 2 | |
// {value: 2, done: false } | |
console.log('Next in array_as_iterable 4', arr.next()) | |
// Next in array_as_iterable 4 | |
// {value: 4, done: false } | |
console.log('Next in array_as_iterable?', arr.next()) | |
// Next in array_as_iterable? | |
// {value: undefined, done: true } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment