Set operations combine or compare collections by membership. They replace roundabout loops and branches with questions such as which items overlap, remain, or should be combined. section 9.3.4
Merging cart items
Incoming items intersecting the saved cart are promoted, active items are combined with incoming items, and saved items are reduced by difference. The result is a new cart rather than a mutation.


