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 인스턴스의 isSupersetOf() 메서드는 하나의 Set을 받아서 주어진 Set의 모든 요소가 이 Set에 속하는지 여부를 가리키는 불리언을 반환합니다.
other Set의 모든 요소가 이 Set 안에 있을 경우 true, 그렇지 않으면 false입니다.
수학적 표기법으로는 상위집합(superset)은 아래와 같이 표현할 수 있습니다.
A⊇B⇔∀x∊B,x∊AA\supseteq B \Leftrightarrow \forall x\in B,,x\in A벤 다이어그램으로는 아래와 같습니다.
참고 : 초집합 관계는 완벽한 상위집합이 아닙니다. isSupersetOf()는 this과 other에 동일한 요소가 포함되어 있으면 true를 반환합니다.
isSupersetOf()는 other 매개변수로 유사 Set 객체를 받습니다. 어떠한 사용자 코드 호출없이 this에 저장된 기본 데이터를 직접 검색하기 때문에 실제 this 인스턴스여야 합니다. 그러면 그 동작은 this와 other의 크기에 따라 달라집니다.
짝수 집합(20 미만)은 4의 배수(20 미만)의 상위집합입니다.
모든 홀수(20 미만)의 집합은 2가 소수는 맞지만 홀수는 아니므로 소수(20 미만)의 상위집합이 아닙니다.
서로 동일한 집합은 서로에 대해 상위집합 관계가 성립합니다.
| ECMAScript® 2027 Language Specification # sec-set.prototype.issupersetof |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2024년 7월 31일 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.