Skip to content

Instantly share code, notes, and snippets.

@NKid
Last active December 11, 2015 03:19
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 NKid/8dd23fa882c288617803 to your computer and use it in GitHub Desktop.
Save NKid/8dd23fa882c288617803 to your computer and use it in GitHub Desktop.
Object.keys()
function Person(name, age) {
this.name = name;
this.age = age;
}
Person.prototype.sayHi = function() {
console.log('Hi')
};
var P1 = new Person('Tom', '20');
var pKeys = Object.keys(P1);
console.log(pKeys); //[ 'name', 'age' ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment