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
const _prop1 = Symbol('prop1'); | |
class Test{ | |
constructor(prop1, prop2){ | |
this[_prop1] = prop1; | |
this.prop2 = prop2; | |
} | |
} | |
const obj = new Test(1,2); | |
for(keys in obj){ | |
console.log(keys); //doesn print _prop1 property |
OlderNewer