Created
June 20, 2012 21:22
-
-
Save nekman/2962311 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
Array.prototype.where = Array.prototype.where || function(predicate) { | |
var results = [], | |
len = this.length, | |
i = 0; | |
for(; i < len; i++) { | |
var item = this[i]; | |
if (predicate(item)) { | |
results.push(item); | |
} | |
} | |
return results; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment