unionWith
Returns every element that exists in any of the two arrays at least once, using a provided comparator function.
- Create a
new Set()
with all values ofa
and values inb
for which the comparator finds no matches ina
, usingArray.prototype.findIndex()
.