Gives values of array not present in another.
npm install @extra-array/difference-onGives values of array not present in another. [:running:] [:vhs:] [:package:] [:moon:]
> Alternatives: [compare], [map].
> This is part of package [extra-array].
[extra-array]: https://www.npmjs.com/package/extra-array
``javascript`
array.differenceOn(x, y, [fn], [ths]);
// x: an array
// y: another array
// fn: map function (v, i, x)
// ths: this argument
`javascript
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]
``
- Data.List.\\: Haskell
- Data.Set.difference: Haskell
- Set.difference: Python
[compare]: https://github.com/nodef/extra-array/wiki/difference
[map]: https://github.com/nodef/extra-array/wiki/differenceOn
[:running:]: https://npm.runkit.com/@extra-array/difference-on
[:package:]: https://www.npmjs.com/package/@extra-array/difference-on
[:moon:]: https://www.npmjs.com/package/@extra-array/difference-on.min
[:vhs:]: https://asciinema.org/a/319348