4 lines
148 B
JavaScript
4 lines
148 B
JavaScript
const unionWith = (a, b, comp) =>
|
|
Array.from(new Set([...a, ...b.filter(x => a.findIndex(y => comp(x, y)) === -1)]));
|
|
module.exports = unionWith;
|