https://github.com/ericadamski/unique-elements
Strip an array of all duplicate entries, including complex objects
https://github.com/ericadamski/unique-elements
array duplicate remove set uniq unique
Last synced: 3 months ago
JSON representation
Strip an array of all duplicate entries, including complex objects
- Host: GitHub
- URL: https://github.com/ericadamski/unique-elements
- Owner: ericadamski
- Created: 2018-05-30T13:15:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-30T13:16:31.000Z (almost 7 years ago)
- Last Synced: 2025-01-06T09:45:31.683Z (5 months ago)
- Topics: array, duplicate, remove, set, uniq, unique
- Language: JavaScript
- Size: 43 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# unique-elements
Strip an array of all duplicate entries, including complex objects
# Install
`$ yarn add unique-elements`
or
`$ npm install unique-elements`
# Usage
```javascript
const unique = require('unique-elements');unique([1, 2, 2, 3, 3, 5, 6, 6, 6, 6]);
// [1, 2, 3, 5, 6]unique(['string', 'another', 'different', 'string']);
// ['string', 'another', 'different']unique([[1, 2, 3], [1, 2, 3], 1, 2, 'string', 1, 'string']);
// [[1, 2, 3], 1, 2, 'string']
```