Created
January 22, 2014 06:25
-
-
Save interlock/8554274 to your computer and use it in GitHub Desktop.
My enumerable property is not enumerable
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
var Example = function() { | |
}; | |
Object.defineProperty(Example.prototype,'message',{ | |
enumerable: true, | |
set: function(v) { | |
this._message = v; | |
}, | |
get: function() { | |
return this._message; | |
} | |
}); | |
var example = new Example(); | |
example.message = "Test 123"; | |
console.log(example); | |
console.log(example.propertyIsEnumerable('message')); | |
console.log(Object.keys(example)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment