3 lines
145 B
JavaScript
3 lines
145 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; |