Last active
August 29, 2015 13:56
-
-
Save slopeofhope81/8845219 to your computer and use it in GitHub Desktop.
defineProperty is JS
This file contains hidden or 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
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