Skip to content

Instantly share code, notes, and snippets.

@moiz-frost
Created September 3, 2019 10:13
Show Gist options
  • Save moiz-frost/0982a523299d3baad70b13f1a6c07b37 to your computer and use it in GitHub Desktop.
Save moiz-frost/0982a523299d3baad70b13f1a6c07b37 to your computer and use it in GitHub Desktop.
Printing car object properties
console.log(Object.getOwnPropertyDescriptors(car));
// Output
/*{ year:
{ value: '2010',
writable: true,
enumerable: true,
configurable: true },
make:
{ value: 'Honda',
writable: true,
enumerable: true,
configurable: true },
color:
{ value: 'White',
writable: true,
enumerable: true,
configurable: true },
transmission:
{ value: 'Manual',
writable: true,
enumerable: true,
configurable: true },
horsePower:
{ value: 140,
writable: true,
enumerable: true,
configurable: true },
topSpeed:
{ value: 120,
writable: true,
enumerable: true,
configurable: true } }*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment