ECMAScript 2025 (ES16)
ECMAScript 2025 (ES16) — ES2025 introduces new features for Set methods, RegExp modifiers, and improvements to Array and Promise APIs. Set.prototype.intersection(): Returns a new Set containing elements present in both sets. Example: new Set([1,2,3]).intersection(new Set([2,3,4])) // Set {2,3}. Set.prototype.union(): Returns a new Set containing all elements from both sets. Example: new Set([1,2]).union(new Set([3,4])) // Set {1,2,3,4}. Set.prototype.difference(): Returns a new Set with elements in the first but not the second. Example: new Set([1,2,3]).difference(new Set([2,3])) // Set {1}. Set.prototype.symmetricDifference(): Returns elements in either set but not both. Example: new Set([1,2]).symmetricDifference(new Set([2,3])) // Set {1,3}. Set.prototype.isSubsetOf(): Returns true if all elements of the first set are in the second. Example: new Set([1,2]).isSubsetOf(new Set([1,2,3])) // true. Set.prototype.isSupersetOf(): Returns true if the first set contains all elements of the second. Example: new Set([1,2,3]).isSupersetOf(new Set([1,2])) // true. In total, ES2025 added 8 documented features to the language. Compare with the other editions on the ECMAScript versions page.