# Module: difference
Takes two arrays and returns the difference between them as a new array. In this case, "difference" is to be understood as the elements of one array not present in the other.
import { difference } from 'utilist';
difference([1, 2, 3], [1, 3]); // returns [2]
# Functions
# difference
▸ difference‹T›(first
: T[], second
: T[]): T[]
Defined in src/difference.ts:22
Type parameters:
▪ T
Parameters:
Name | Type | Description |
---|---|---|
first | T[] | First array. |
second | T[] | Second array. |
Returns: T[]