Skip to content

Instantly share code, notes, and snippets.

@cyberpirate92
Created May 30, 2018 04:02
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 cyberpirate92/57566ca230677bfcc2ffc3889a1786c9 to your computer and use it in GitHub Desktop.
Save cyberpirate92/57566ca230677bfcc2ffc3889a1786c9 to your computer and use it in GitHub Desktop.
var z = {
name: 'Bill',
age: 30
}
Object.keys(z); // ['name', 'age']
Object.defineProperty(z, 'name', { enumerable: false });
Object.keys(z); // ['age']
// to get all properties (including non-enumerable properties)
Object.getOwnPropertyNames(z); // ['name', 'age']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment