diginext-utils
Version:
README.md
17 lines • 571 B
TypeScript
/**
* Creates an array of values from the first array that are not present in the second array.
*
* @template T - The type of elements in the arrays
* @param array1 - Array to check
* @param array2 - Values to exclude
* @returns A new array with values from array1 not in array2
*
* @example
* ```ts
* difference([1, 2, 3, 4], [2, 4]); // [1, 3]
* difference(['a', 'b', 'c'], ['b']); // ['a', 'c']
* difference([1, 2], [3, 4]); // [1, 2]
* ```
*/
export declare function difference<T>(array1: T[], array2: T[]): T[];
//# sourceMappingURL=difference.d.ts.map