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

Set.prototype.intersection() - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

Set.prototype.intersection()

Baseline 2024

20246

intersection() Set Set Set

js
intersection(other)

other

Set Set

Set Set other

(intersection)

AB={xAxB}A\cap B = \{x\in A\mid x\in B\}

2 AB [2 AB]

intersection() Set other this this Set this other

  • this other.size other keys() this Set
  • this this e other.has(e) Set

intersection() this other Set Set this other

intersection()

10 10

js
const odds = new Set([1, 3, 5, 7, 9]);
const squares = new Set([1, 4, 9]);
console.log(odds.intersection(squares)); // Set(2) { 1, 9 }

ECMAScript 2027 LanguageSpecification
# sec-set.prototype.intersection


Web Proxy Viewer  |  New URL  |  Original Page