Skip to content

Instantly share code, notes, and snippets.

@mturnwall
Created March 5, 2013 00:29
Show Gist options
  • Save mturnwall/5086988 to your computer and use it in GitHub Desktop.
Save mturnwall/5086988 to your computer and use it in GitHub Desktop.
Get a list of the property keys for an object in javascript
var temp = {a: 1, b: 2, c: 3};
var temp2 = [];
for (var propertyName in temp) {
temp2.push(propertyName);
}
console.log(temp2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment