Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
Since June 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Set 인스턴스의 isDisjointFrom() 메소드는 집합을 받아서 집합을 받아 이 집합이 주어진 집합과 공통 요소가 없는지 여부를 나타내는 불리언을 반환합니다.
만약 other 집합과의 공통 요소가 없다면 true, 그렇지 않으면 false를 반환합니다.
두 집합이 공통된 요소가 없다면 두 집합은 서로소 집합입니다. 수학적 표기법은 다음과 같습니다.
A is disjoint from B⇔A∩B=∅A\text{ is disjoint from }B \Leftrightarrow A\cap B = \empty벤 다이어그램을 사용하자면 다음과 같습니다.
union()은 other 매개변수로 유사 집합 객체를 받습니다. 사용자 코드를 호출하지 않고 this에 저장된 기본 데이터를 직접 검색하기 때문에 this는 실제 Set 인스턴스여야합니다. 그 다음의 행동은 this와 other의 크기에 달려있습니다.
이 구현으로 인해 isDisjointFrom()의 효율성은 대부분 this와 other 중 더 작은 집합의 크기에 따라 달라집니다(집합을 선형 이하 시간 내에 접근할 수 있다고 가정할 때).
완전 제곱수의 집합(20 미만)은 소수 집합(20 미만)과 분리되어 있는데, 이는 완전 제곱수은 정의상 두 정수의 곱으로 분해할 수 있는 반면 1은 소수로 간주되지 않기 때문입니다.
1이 아닌 모든 완전 제곱수는 정의상 합성수이므로 완전 제곱수의 집합(20 미만)은 합성수의 집합(20 미만)과 분리되지 않습니다.
| ECMAScript® 2027 Language Specification # sec-set.prototype.isdisjointfrom |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2024년 5월 12일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.