@extra-array/difference-on
TypeScript icon, indicating that this package has built-in type declarations

2.7.8 • Public • Published

Gives values of array not present in another. 🏃 📼 📦 🌔

Alternatives: compare, map.
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

Package Sidebar

Install

npm i @extra-array/difference-on

Weekly Downloads

0

Version

2.7.8

License

MIT

Unpacked Size

9.76 kB

Total Files

24

Last publish

Collaborators

  • wolfram77