Function difference

Returns elements from source array that are not in the exclude array. Preserves uniqueness and order from the source array.

difference([2, 3])([1, 2, 3, 4]);
// => [1, 4]
  • Type Parameters

    • T

      Element type

    Parameters

    • exclude: readonly T[]

      Array of elements to exclude

    Returns (source: readonly T[]) => T[]

    Array of elements not in exclude