Skip to content

unique<T>

Remove duplicates from an array.

Import:

import { unique } from '@mnaoumov/typescript-lib/array';

Signature:

function unique(array: readonly T[]): T[]

Parameters:

Parameter Type Description
array readonly T[] The array to remove duplicates from.

Returns: T[] — The array with duplicates removed.