Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nescalante/distinct
get distinct values from an array
https://github.com/nescalante/distinct
Last synced: 20 days ago
JSON representation
get distinct values from an array
- Host: GitHub
- URL: https://github.com/nescalante/distinct
- Owner: nescalante
- License: mit
- Created: 2015-01-14T19:01:47.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-01T00:36:56.000Z (over 7 years ago)
- Last Synced: 2024-11-14T23:09:25.593Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://nescalante.github.io
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# distinct()
[![Greenkeeper badge](https://badges.greenkeeper.io/nescalante/distinct.svg)](https://greenkeeper.io/)
Because nobody wants repeated things
## Install
```shell
npm install distinct
```Just call it and it will retrieve just all distinct values
```js
var distinct = require('distinct');
var arr = distinct([1, 1, 2, 3, 3, 3, 4]);console.log(arr); // [1, 2, 3, 4]
```Thats it!
Keep in mind that `distinct` uses the [`equals`](https://github.com/jkroso/equals) package to compare items.
## License
MIT