Function setIntersection

  • Computes the intersection of multiple sets.

    Type Parameters

    • T

    Parameters

    • sets: Set<T>[]

      An array of sets to compute the intersection from.

    Returns Set<T>

    The intersection of all sets in the array.

    Typeparam

    T - The type of elements in the sets.

    Example

    const set1 = new Set([1, 2, 3]);
    const set2 = new Set([2, 3, 4]);
    const set3 = new Set([3, 4, 5]);
    setIntersection([set1, set2, set3]);
    //=> new Set([3])

Generated using TypeDoc