I'm trying to use defineProperty to made attributes not appear in for...in cycle, but it doesn't work. Is this code correct?
function Item() {
this.enumerable = "enum";
this.nonEnum = "noEnum";
}
Object.defineProperty(Item, "nonEnum", { enumerable: false });
var test = new Item();
for (var tmp in test){
console.log(tmp);
}