Skip to content

Instantly share code, notes, and snippets.

@shaunwallace
Created November 19, 2014 12:48
Show Gist options
  • Select an option

  • Save shaunwallace/3d1b475128f9b842df78 to your computer and use it in GitHub Desktop.

Select an option

Save shaunwallace/3d1b475128f9b842df78 to your computer and use it in GitHub Desktop.
Object.preventExtensions()
var obj11 = Object.create(Object.prototype, { foo : {
value : 27
},
bar : {
value : 39,
enumerable : true
}
});
Object.preventExtensions( obj11 );
obj11.baz = 47;
obj11.baz; // returns undefined
Object.keys( obj11 ); // returns ["bar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment