Skip to content

Instantly share code, notes, and snippets.

@dannycroft
Created December 5, 2013 08:45
Show Gist options
  • Select an option

  • Save dannycroft/7802088 to your computer and use it in GitHub Desktop.

Select an option

Save dannycroft/7802088 to your computer and use it in GitHub Desktop.
Object.keys pollyfill
Object.keys = function (obj) {
var keys = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
keys.push(key);
}
}
return keys;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment