For sets:
var merged = new Set([...set1, ...set2, ...set3])
For maps:
var merged = new Map([...map1, ...map2, ...map3])
Note that if multiple maps have the same key, the value of the merged map will be the value of the last merging map with that key.
More Related Contents:
- es6 Map and Set complexity, v8 implementation
- How to reliably check an object is an EcmaScript 6 Map/Set?
- comparing ECMA6 sets for equality
- `export const` vs. `export default` in ES6
- Javascript – arrow functions this in event handler?
- How does this object method definition work without the “function” keyword?
- What is the temporal dead zone?
- Are ES6 classes just syntactic sugar for the prototypal pattern in Javascript?
- ES6 Array destructuring weirdness
- Get functions (methods) of a class [duplicate]
- ES6 Iterate over class methods
- Can’t require() default export value in Babel 6.x
- Access to ES6 array element index inside for-of loop
- ES6 Destructuring and Module imports
- Using spread operator multiple times in javascript?
- forEach is not a function error with JavaScript array
- Why do I have to .bind(this) for methods defined in React component class, but not in regular ES6 class
- ES6: Is it dangerous to delete elements from Set/Map during Set/Map iteration?
- where is create-react-app webpack config and files?
- Extending Error in Javascript with ES6 syntax & Babel
- Best way to polyfill ES6 features in React app that uses create-react-app
- What is the defined execution order of ES6 imports?
- JSON stringify ES6 class property with getter/setter
- How to create new instance of an extended class of custom elements
- Get the description of a ES6 Symbol
- How to loop over object properties with ngFor in Angular
- Using ‘let’ as a variable name is not throwing any errors in google v8
- Is this a good way to clone an object in ES6?
- How to create an array of objects from multiple arrays
- How to understand JS realms