Skip to content

Instantly share code, notes, and snippets.

@interlock
Created January 22, 2014 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save interlock/8554274 to your computer and use it in GitHub Desktop.
Save interlock/8554274 to your computer and use it in GitHub Desktop.
My enumerable property is not enumerable
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