Options
All
  • Public
  • Public/Protected
  • All
Menu

Module difference

Index

References

Functions Array

References

Renames and re-exports difference

Array Functions

  • difference(array: any, ...values: any[]): any
  • Creates an array of array values not included in the other given arrays using SameValueZero for equality comparisons. The order and references of result values are determined by the first array.

    Note: Unlike pullAll, this method returns a new array.

    since

    5.9.0

    see

    union, unionBy, unionWith, without, xor, xorBy, xorWith,

    example
    difference([2, 1], [2, 3])
    // => [1]

    Parameters

    • array: any

      The array to inspect.

    • Rest ...values: any[]

      The values to exclude.

    Returns any

    Returns the new array of filtered values.