Last active
April 26, 2017 04:57
-
-
Save Ibro/c9d50deba6a3161231bb933d7cc320bc to your computer and use it in GitHub Desktop.
JavaScript symbols for-in loop - Coding Blast - www.codingblast.com
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
let symbol1 = Symbol(); | |
let symbol2 = Symbol(); | |
var obj = { | |
a: 13, | |
[symbol1]: 5, | |
[symbol2]: 11 | |
}; | |
let props = []; | |
for(let prop in obj) { | |
props.push(prop); | |
} | |
console.log(props); // ["a"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment