Creating a class that wraps a Set to work with more complex types

Knowing what types we are working with is valuable. WeakSet has some restriction on membership, but as you may know, objects can vary quite a lot.

In this recipe, we'll take a look at how to create a wrapper class for Map in order to control what types are used in the Map.

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.