Working with Sets

In this chapter, we will cover the following recipes:

  • Adding and deleting items from a Set
  • Creating a Set from existing data
  • Adding and deleting items from a WeakSet
  • Creating a WeakSet from existing data
  • Finding the union of two sets
  • Finding the intersection of two sets
  • Finding the difference between two sets
  • Creating a class that wraps a Set to work with more complex types

Get ECMAScript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.