Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

array-uniq

sindresorhus26.9mMIT3.0.0TypeScript support: included

Create an array without duplicates

array, set, uniq, unique, duplicate, remove

readme

array-uniq

Create an array without duplicates

Install

$ npm install array-uniq

Usage

import arrayUniq from 'array-uniq';

arrayUniq([1, 1, 2, 3, 3]);
//=> [1, 2, 3]

arrayUniq(['foo', 'foo', 'bar', 'foo']);
//=> ['foo', 'bar']

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.