Javascript Array selectOne(filter)

Description

Javascript Array selectOne(filter)

Array.prototype.selectOne = function(filter)
{
 for (var i = 0; i< this.length; i++) {
  if(filter(this[i])){
   return this[i];
  }/*from www  .j av  a2  s. co m*/
    }
 return null;
}



PreviousNext

Related