Skip to content

Instantly share code, notes, and snippets.

@saikat
Created April 27, 2010 02:45
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 saikat/380263 to your computer and use it in GitHub Desktop.
Save saikat/380263 to your computer and use it in GitHub Desktop.
if (!Object.keys) {
Object.keys = function( obj ) {
var array = new Array();
for ( var prop in obj ) {
if ( obj.hasOwnProperty( prop ) ) {
array.push( prop );
}
}
return array;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment