Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/difference

Index

References

Functions

References

Renames and re-exports difference

Functions

  • difference<T>(list1: ArrayLike<T>, list2: ArrayLike<T>): T[]
  • difference<T>(list1: ArrayLike<T>): (list2: ArrayLike<T>) => T[]
  • Returns the array of all elements in the first array not contained in the second array.

    example
     difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]
    difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]

    Type parameters

    • T

    Parameters

    • list1: ArrayLike<T>
    • list2: ArrayLike<T>

    Returns T[]

    The elements in a that are not in b.

  • Returns the array of all elements in the first array not contained in the second array.

    example
     difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]
    difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]

    Type parameters

    • T

    Parameters

    • list1: ArrayLike<T>

    Returns (list2: ArrayLike<T>) => T[]

    The elements in a that are not in b.

      • (list2: ArrayLike<T>): T[]
      • Parameters

        • list2: ArrayLike<T>

        Returns T[]

Generated using TypeDoc