Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
671 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | # array-uniq [![Build Status](https://travis-ci.org/sindresorhus/array-uniq.svg?branch=master)](https://travis-ci.org/sindresorhus/array-uniq)
|
---|
| 2 |
|
---|
| 3 | > Create an array without duplicates
|
---|
| 4 |
|
---|
| 5 | It's already pretty fast, but will be much faster when [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) becomes available in V8 (especially with large arrays).
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | ## Install
|
---|
| 9 |
|
---|
| 10 | ```
|
---|
| 11 | $ npm install --save array-uniq
|
---|
| 12 | ```
|
---|
| 13 |
|
---|
| 14 |
|
---|
| 15 | ## Usage
|
---|
| 16 |
|
---|
| 17 | ```js
|
---|
| 18 | const arrayUniq = require('array-uniq');
|
---|
| 19 |
|
---|
| 20 | arrayUniq([1, 1, 2, 3, 3]);
|
---|
| 21 | //=> [1, 2, 3]
|
---|
| 22 |
|
---|
| 23 | arrayUniq(['foo', 'foo', 'bar', 'foo']);
|
---|
| 24 | //=> ['foo', 'bar']
|
---|
| 25 | ```
|
---|
| 26 |
|
---|
| 27 |
|
---|
| 28 | ## License
|
---|
| 29 |
|
---|
| 30 | MIT © [Sindre Sorhus](https://sindresorhus.com)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.