Created
March 21, 2019 03:27
-
-
Save singhArmani/2d59d61b1d10076e17ac8b897bb148d2 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
var obj = { x: 1, y: 2, z: 3 }; | |
obj[Symbol.iterator] = function*() { | |
yield 1; | |
yield 2; | |
yield 3; | |
}; | |
[...obj]; // print [1, 2, 3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment