Javascript Array where(callback)

Description

Javascript Array where(callback)

Array.prototype.where = function(callback){
 if(!callback) return;
 for(var i = 0; i < this.length; i++){
  if(callback(this[i])){
   return this[i];
  }/*www . j  av  a2  s  .c  o  m*/
 }
}



PreviousNext

Related