JS books (free online) | Newsletter | Training 2ality – JavaScript and more About | Donate | Subscribe | Archive | Search | ES2016+ES2017 | ES2018 react-text: 29 [ /react-text react-text: 30 2015-01-14 /react-text react-text: 31 ] /react-text react-text: 32 esnext, dev, javascript /react-text (Ad, please don’t block) Check out my book (free online): “ Exploring ES6 ”. Updated version of this blog post: section “ Union, intersection, difference ”. A recent question by Dmitry Moskowski reminded me: ECMAScript 6 sets have no methods for computing the union (e.g. addAll ), intersection (e.g. retainAll ) or difference (e.g. removeAll ). This blog post explains how to work around that limitation. more # Union ( a ∪ b ): create a set that contains the elements of both set a and set b . let a = new Set ([ 1 , 2 , 3 ]); let b = new Set ([ 4 , 3 , 2 ]); let union = new Set ([...a, .....