4.17.11
3.10.1
2.4.2
1.3.1

_.difference(array, [values])

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

0.1.0

Arguments

argument
array
[values]
type
Array
...Array
description
The array to inspect.
The values to exclude.

Returns

(array)

Example

_.difference([2, 1], [2, 3]);
// => [1]
_.difference([2, 1], [2, 3]);
// => [1]