Javascript Array remove(item, field)

Description

Javascript Array remove(item, field)


Array.prototype.remove = function (item, field) {

    var array = this;
    for (var i = 0; i < array.length; i++) {

        if (array[i][field] == item) {
            array.splice(i, 1);/*from w  w w  . j  a  v a2 s.c  o m*/
            break;
        }
    }

};



PreviousNext

Related