Created
July 11, 2010 00:47
-
-
Save pkrumins/471164 to your computer and use it in GitHub Desktop.
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
// annoyingly many browsers don't have these: | |
if (!Object.keys) Object.keys = function (obj) { | |
var keys = []; | |
for (var key in obj) { | |
if (obj.hasOwnProperty(key)) { | |
keys.push(key); | |
} | |
} | |
return keys; | |
}; | |
if (!Array.prototype.forEach) Array.prototype.forEach = function (f) { | |
for (var i = 0; i < this.length; i++) | |
f(this[i]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment