JSPM

  • Created
  • Published
  • Downloads 45
  • Score
    100M100P100Q53641F
  • License MIT

Gives values of an array not present in another.

Package Exports

  • @extra-array/difference-on

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@extra-array/difference-on) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Gives values of an array not present in another.

This is part of package extra-array.

array.differenceOn(x, y, [fn], [ths]);
// x:   an array
// y:   another array
// fn:  map function (v, i, x)
// ths: this argument
const array = require('extra-array');

var x = [1, 2, 3, 4, 5];
array.differenceOn(x, [2, 4]);
// [1, 3, 5]

array.differenceOn(x, [-2, -4]);
// [1, 2, 3, 4, 5]

array.differenceOn(x, [-2, -4], v => Math.abs(v));
// [1, 3, 5]

references