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

2.7.8 • Public • Published

Gives values present in both arrays. 🏃 📼 📦 🌔

Alternatives: compare, map.
This is part of package extra-array.

array.intersectionOn(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];
array.intersectionOn(x, [2, 3, 5]);
// [2, 3]

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

references

Package Sidebar

Install

npm i @extra-array/intersection-on

Weekly Downloads

27

Version

2.7.8

License

MIT

Unpacked Size

9.53 kB

Total Files

24

Last publish

Collaborators

  • wolfram77