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

Package detail

@arr/unique

lukeed56MIT1.0.1TypeScript support: included

A tiny (111B) & fast utility to retrieve all unique values from an Array

arr, array, Array.unique, Array.prototype.unique, performance, native, unique

readme

@arr/unique

Tiny (111B) & fast utility to retrieve all unique values from an Array.

Install

$ npm install --save @arr/unique

Usage

import unique from '@arr/unique';

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

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

API

unique(arr)

arr

Type: Array
The array to iterate upon.

License

MIT © Luke Edwards