Created
December 5, 2013 08:45
-
-
Save dannycroft/7802088 to your computer and use it in GitHub Desktop.
Object.keys pollyfill
This file contains hidden or 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
| 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