| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Set/union | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
Since 2024 6, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Set union()
.
union(other)
other Set .
(union) .
AB={xxA or xB}A\cup B = {x\midx\in A\text{ or }x\in B}.
union() other . this this Set . keys() other this other .
this , other .
(<10) (<10) . .
const evens = new Set([2, 4, 6, 8]);
const squares = new Set([1, 4, 9]);
console.log(evens.union(squares)); // Set(6) { 2, 4, 6, 8, 1, 9 }
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-set.prototype.union |
Set.prototype.union in core-jsSet.prototype.difference()Set.prototype.intersection()Set.prototype.isDisjointFrom()Set.prototype.isSubsetOf()Set.prototype.isSupersetOf()Set.prototype.symmetricDifference()This page was last modified on 2026 7 15 by MDN contributors.
SetSet.prototype.add()Set.prototype.clear()Set.prototype.delete()Set.prototype.difference()Set.prototype.entries()Set.prototype.forEach()Set.prototype.has()Set.prototype.intersection()Set.prototype.isDisjointFrom()Set.prototype.isSubsetOf()Set.prototype.isSupersetOf()Set.prototype.keys()Set.prototype.symmetricDifference()Set.prototype.union()Set.prototype.values()Set.prototype[@@iterator]()Object/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |