difference
Calculates the difference between two arrays, without filtering duplicate values.
- Create a
Setfrombto get the unique values inb. - Use
Array.prototype.filter()onato only keep values not contained inb, usingSet.prototype.has().
Calculates the difference between two arrays, without filtering duplicate values.
Set from b to get the unique values in b.Array.prototype.filter() on a to only keep values not contained in b, using Set.prototype.has().