Skip to content

Instantly share code, notes, and snippets.

@lethalbrains
Created July 12, 2017 10:44
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 lethalbrains/23b8e1b12b63b3d2ece90a9dd3aebb56 to your computer and use it in GitHub Desktop.
Save lethalbrains/23b8e1b12b63b3d2ece90a9dd3aebb56 to your computer and use it in GitHub Desktop.
const obj = {
id: 123,
get bar() { return 'abc' },
};
console.log(Object.getOwnPropertyDescriptors(obj));
> { id:
{ value: 123,
writable: true,
enumerable: true,
configurable: true },
bar:
{ get: [Function: bar],
set: undefined,
enumerable: true,
configurable: true } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment