concept two set in category javascript

appears as: two sets
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond

This is an excerpt from Manning's book Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond.

  • union—A function that takes two sets and returns a new set with all the values from both sets
  • intersection—A function that takes two sets and returns a new set with only the values that are in both sets
  • subtract—A function that takes two sets and returns a new set with all of the values from the first set, excluding any values that are in the second set
  • difference—A function that takes two sets and returns a new set of only the values they aren’t in both sets (the opposite of intersection)