Skip to content

Instantly share code, notes, and snippets.

@slopeofhope81
Last active August 29, 2015 13:56
Show Gist options
  • Save slopeofhope81/8845219 to your computer and use it in GitHub Desktop.
Save slopeofhope81/8845219 to your computer and use it in GitHub Desktop.
defineProperty is JS
To set attributes of a property or to create a new property with the specified attributes.
var a = {};
Object.defineProperty(0, "x", {value:1, writable: true, enumerable:false, configurable: true});
Guess what this does?
Also changing this (data property to an accessor property) =>
Object.defineProperty(0, "x", { get: function(){ return 0} });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment