Javascript Array containsReturn(key, value)

Description

Javascript Array containsReturn(key, value)

Array.prototype.containsReturn = function(key, value) {
    var i = this.length;
    while (i--) {
        if (this[i][key] === value){
            return i;
        }/*  w w  w . jav a 2s.c o m*/
    }
    return false;
}



PreviousNext

Related