Created
October 7, 2013 06:07
-
-
Save umidjons/6863188 to your computer and use it in GitHub Desktop.
Object.keys() fallback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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