Skip to content
Subhajit Sahu edited this page Dec 28, 2022 · 13 revisions

Obtain entries present in any ilists.

Similar: union, intersection, difference, symmetricDifference, isDisjoint.


function union(x, y, fc)
// x:  ilists
// y:  another ilists
// fc: combine function (a, b)
const xilists = require('extra-ilists');

var x = [['a', 'b', 'c'], [1, 2, 3]];
var y = [['b', 'c', 'd'], [20, 30, 40]];
xilists.union(x, y).map(v => [...v]);
// → [ [ 'a', 'b', 'c', 'd' ], [ 1, 2, 3, 40 ] ]

xilists.union(x, y, (a, b) => b).map(v => [...v]);
// → [ [ 'a', 'b', 'c', 'd' ], [ 1, 20, 30, 40 ] ]


References

Clone this wiki locally