GitHub

unique

Helper

import { unique } from '@daffodil/core'

Filters an array of elements, removing duplicates. Does not guarantee order of filtered elements.

An optional comparator function may be passed for arbitrary comparison behavior. The default is a strict equality comparison: a === b.

function unique<T>(
  array: T[]
  comparator: (a: T, b: T) => boolean = (a, b) => a === b
): T[]

Parameters

Parameterarray: T[]
Description
Parametercomparator: (a: T, b: T) => boolean
Default(a, b) => a === b
Description