Skip to content

Instantly share code, notes, and snippets.

@Ibro
Last active April 26, 2017 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ibro/c9d50deba6a3161231bb933d7cc320bc to your computer and use it in GitHub Desktop.
Save Ibro/c9d50deba6a3161231bb933d7cc320bc to your computer and use it in GitHub Desktop.
JavaScript symbols for-in loop - Coding Blast - www.codingblast.com
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