[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Set/union [Back]  [Original]

Set.prototype.union() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Set.prototype.union()

Baseline 2024
Newly available

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() .

In this article

js
union(other)

other

Set

other Set .

(union) .

AB={xxA or xB}A\cup B = {x\midx\in A\text{ or }x\in B}

.

     . A B          . [ . A B .]

union() other . this this Set . keys() other this other .

this , other .

union()

(<10) (<10) . .

js
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


Web Proxy Viewer  |  New URL  |  Original Page