common-stuff
    Preparing search index...

    Function difference

    • Creates an array of array values not included in the other given arrays.

      Type Parameters

      • T
      • T2

      Parameters

      • array: T[]
      • values: readonly T2[]
      • Optionalkey: (value: T | T2) => unknown

      Returns T[]

      difference([2, 1], [2, 3])
      // [1]

      difference([2, 1], ['2', '3'], (a, b) => a === parseInt(b))
      // [1]
    • Creates an array of array values not included in the other given arrays.

      Type Parameters

      • T
      • T2

      Parameters

      • array: readonly T[]
      • values: readonly T2[]
      • Optionalkey: (value: T | T2) => unknown

      Returns readonly T[]

      difference([2, 1], [2, 3])
      // [1]

      difference([2, 1], ['2', '3'], (a, b) => a === parseInt(b))
      // [1]