Last active
April 26, 2017 04:56
-
-
Save devmobasa/5296910a82e8bf3078f334eacb0c9871 to your computer and use it in GitHub Desktop.
JavaScript symbols - getOwnPropertySymbols - Coding Blast - www.codingblast.com
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
| let symbol1 = Symbol('coding'); | |
| let symbol2 = Symbol('blast'); | |
| var obj = { | |
| a: 13, | |
| [symbol1]: 5, | |
| [symbol2]: 11 | |
| }; | |
| let symbolProps = Object.getOwnPropertySymbols (obj); | |
| console.log(symbolProps); // [Symbol(coding), Symbol(blast)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment