Skip to content

Instantly share code, notes, and snippets.

@phpnode
Created August 5, 2014 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpnode/461cb29c80aa2f8ab440 to your computer and use it in GitHub Desktop.
Save phpnode/461cb29c80aa2f8ab440 to your computer and use it in GitHub Desktop.
var foo = {};
Object.defineProperty(foo, 'bar', {
value: 123,
anotherKey: "hello world",
extraKey: true
});
var descriptor = Object.getOwnPropertyDescriptor(foo, 'bar');
expect(descriptor.extraKey).to.be.true; // nope, undefined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment