Skip to content

Instantly share code, notes, and snippets.

@niyazpk
Created December 11, 2011 14:12
Show Gist options
  • Select an option

  • Save niyazpk/1460789 to your computer and use it in GitHub Desktop.

Select an option

Save niyazpk/1460789 to your computer and use it in GitHub Desktop.
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