Skip to content

Instantly share code, notes, and snippets.

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