@extra-array/intersection-on.min

Gives values present in both arrays.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-array/intersection-on.min
1622.7.83 years ago3 years agoMinified + gzip package size for @extra-array/intersection-on.min in KB

Readme

Gives values present in both arrays. :running: :vhs: :package: :moon:
Alternatives: compare, map.
This is part of package extra-array.

This is browserified, minified version of @extra-array/intersection-on.
It is exported as global variable arrayintersectionOn.
CDN: unpkg
, jsDelivr.

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