Javascript Array diff(part)

Description

Javascript Array diff(part)

Array.prototype.diff = function (part) {
  return this.filter(function (element) {return part.indexOf(element) < 0})
}

export default Array// w w  w  .  j  av  a2s. c o m

Javascript Array diff(part)

Array.prototype.diff = function(part) {
    return this.filter(function(element) {return part.indexOf(element) < 0;});
};



PreviousNext

Related