• Implementation of the superset operation, which checks if set A is a superset of set B. A superset means all elements of set B are elements of A.

    • Formal definition: A ⊇ B
    • This method runs in bilinear time, or O(n * m), where n = |A| (size of set A), and m = |B| (set of size B)

    Type Parameters

    • TElement

    Parameters

    • a: Set<TElement>

      Set A of type <TElement> elements

    • b: Set<TElement>

      Set B of type <TElement> elements

    Returns boolean

    Whether A ⊇ B is true

    See

    Set.prototype.isSupersetOf

    Example

    // {1, 2, 3} ⊇ {1, 2, 3}
    isSupersetOf(new Set([1, 2, 3]), new Set([1, 2, 3])) // true

Generated using TypeDoc