@extra-iterable/intersection-on.min

Gives values present in both iterables.

Downloads in past

Stats

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

Readme

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

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

iterable.intersectionOn(x, y, [fn], [ths]);
// x:   an iterable
// y:   another iterable
// fn:  map function (v, i, x)
// ths: this argument

const iterable = require('extra-iterable');

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

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

references