Gives values present in both iterables. :running: :vhs: :package: :moon: :ledger:
Alternatives: compare, map.
This is part of package extra-iterable.
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 ]