Javascript Array find(predicateFn)
Array.prototype.find = function (predicateFn) { for (var i = 0; i < this.length; i++) { if ( predicateFn(this[i]) ) return this[i] }/*from w w w .jav a 2 s . co m*/ return null }