Function includesAll

  • Checks if all values from provided values array are included in the provided array using provided comparator function (or by default comparing using ===).

    Type Parameters

    • T
    • T2

    Parameters

    • array: readonly T[]
    • values: readonly T2[]
    • key: ((value) => unknown) = ...
        • (value): unknown
        • Parameters

          Returns unknown

    Returns boolean

    Example

    includesAll([1, 2, 3], [1, 2])
    // true