You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
671 B

4 years ago
  1. # array-uniq [![Build Status](https://travis-ci.org/sindresorhus/array-uniq.svg?branch=master)](https://travis-ci.org/sindresorhus/array-uniq)
  2. > Create an array without duplicates
  3. 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).
  4. ## Install
  5. ```
  6. $ npm install --save array-uniq
  7. ```
  8. ## Usage
  9. ```js
  10. const arrayUniq = require('array-uniq');
  11. arrayUniq([1, 1, 2, 3, 3]);
  12. //=> [1, 2, 3]
  13. arrayUniq(['foo', 'foo', 'bar', 'foo']);
  14. //=> ['foo', 'bar']
  15. ```
  16. ## License
  17. MIT © [Sindre Sorhus](https://sindresorhus.com)