Skip to content

Instantly share code, notes, and snippets.

@umidjons
Created October 7, 2013 06:07
Show Gist options
  • Save umidjons/6863188 to your computer and use it in GitHub Desktop.
Save umidjons/6863188 to your computer and use it in GitHub Desktop.
Object.keys() fallback
if(!('keys' in Object))
Object.prototype.keys=function(data)
{
var keys=[];
for(var prop in data)
if(data.hasOwnProperty(prop))
keys.push(prop);
return keys;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment