Javascript Array remove(remove)

Description

Javascript Array remove(remove)


"use strict";/*from   w w w  . j  a va 2 s  .c  o m*/

Array.prototype.remove = function(remove) {
    // to remove is a function
    var arr = [];
    for (let i = 0; i < this.length; i++) {
        if (!remove(this[i])) {
            arr.push(this[i])
        }
    }
    return arr
}

Previewer.init()



PreviousNext

Related