There is a proposal to add methods like union and intersection to JavaScript's built-in Set class. It is currently at stage 3, but some browsers like Chrome already support it. Currently, you can safely use these methods by using polyfills. Let us explain each method by examples of how to use these functions.