Javascript Array containsByProp(propName, value)

Description

Javascript Array containsByProp(propName, value)


Array.prototype.containsByProp = function(propName, value){
  for (var i = this.length - 1; i > -1; i--) {
    var propObj = this[i];
      if(propObj[propName] === value) {
        return true;
    }/* ww w  . j ava 2 s  .  co m*/
  }
return false;
}



PreviousNext

Related