Created
November 19, 2014 12:48
-
-
Save shaunwallace/3d1b475128f9b842df78 to your computer and use it in GitHub Desktop.
Object.preventExtensions()
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
| 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