Created
December 11, 2011 14:12
-
-
Save niyazpk/1460789 to your computer and use it in GitHub Desktop.
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 my_object = {foo: bar}; // object literals are a good part of JavaScript | |
| // the above is equallant to the following code in ES5 | |
| // Notice that a lot of internals are exposed | |
| var my_object = Object.defineProperties( | |
| Object.create(Object.prototype), { | |
| foo: { | |
| value: bar, | |
| writable: true, | |
| enumerable: true, | |
| configurable: true | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment