Javascript Array getIndexOfObject(prop, value)

Description

Javascript Array getIndexOfObject(prop, value)



Array.prototype.getIndexOfObject = function(prop, value){
    for (var i = 0; i < this.length ; i++) {
        if (this[i][prop] === value) {
            return i;
        }// w w  w.jav a2s . co  m
    }
}



PreviousNext

Related