Skip to main content
Module

x/nameable/deps.ts>uniq

Cross-check whether it can be used as a package name or domain name
Latest
variable uniq
import { uniq } from "https://deno.land/x/nameable@v1.1.0-beta.4/deps.ts";

Returns a new Array containing only one copy of each element in the original array. equal is used to determine equality.

Examples

Example 1

uniq([1, 2, 1, 1]) // [1, 2]
uniq([{}, {}, [], []]) // [{}, []]
uniq([[1, 2, 3], [1, 2, 3]]) // [[1, 2, 3]]

type

<T extends unknown>(val: readonly T[]) => T[]