Created
December 27, 2019 11:23
-
-
Save behnamazimi/34c3c3d49b0f41a053c29ef4bf2bb56f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 data = ["A", "B", "C"]; | |
console.log(typeof data[Symbol.iterator]) //o: "function" | |
const iterator = data[Symbol.iterator](); | |
console.log(iterator.next()) //o: {value: "A", done: false} | |
console.log(iterator.next()) //o: {value: "B", done: false} | |
console.log(iterator.next()) //o: {value: "C", done: false} | |
console.log(iterator.next()) //o: {value: undefined, done: true} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment