Javascript Array getItem(key, value)

Description

Javascript Array getItem(key, value)


Array.prototype.getItem = function(key, value) {
    for (var i=0; i < this.length; i++) {
        if (this[i][key] === value) {
            return this[i];
        }// www. j av a  2s . com
    }
}



PreviousNext

Related