JS Built-ins
← Set78 / 85
SetisSupersetOfintermediate

Set isSupersetOf() β€” every set is superset of empty

πŸ“– Usage Example
const a = new Set([1, 2, 3])
const b = new Set([1, 2])
a.isSupersetOf(b)   // β†’ true
b.isSupersetOf(a)   // β†’ false

Use Set.isSupersetOf() to check whether a set contains all elements of another set.

Set.prototype.isSupersetOf() (ES2025)

Every Set is a superset of the empty Set.

Challenge: Verify that any Set is a superset of the empty Set.

πŸ’‘ Hints (1)
  • β€’ Every set is a superset of βˆ… because there are no elements to fail