list-unique
v1.0.1
Published
JavaScript Package for Creating an array without duplicates
Downloads
1
Maintainers
Readme
list-unique
JavaScript Package for Creating an array without duplicates
Features
npm
Install
npm install --save list-unique
Script tag
For Production
<script src="https://cdn.rawgit.com/Prosen-Ghosh/list-unique/a10489e4/unique.js"></script>
For Development
<script src="https://rawgit.com/Prosen-Ghosh/list-unique/master/unique.js"></script>
Usage
const list = require('list-unique');
list.unique([1,2,3,6,4,1,1,2,]);
//=> [ 1, 2, 3, 6, 4 ]
list.union([1,2],[3,4,5])
//=> [ 1, 2, 3, 4, 5 ]
list.intersection([1,2,1,3],[1,2,2,5,4,6,2]);
//=> [ 1, 2 ]
list.diff([1,2,1,3],[1,2,2,,2]);
//=> [ 3 ]
list.unique(["foo","bar","baz","foo","baz"]);
//=> [ 'foo', 'bar', 'baz' ]
list.union(["foo","bar"],["baz","bar"]);
//=> [ 'foo', 'bar', 'baz' ]
list.diff(["foo","bar","baz","foo","baz"],["foo","bar","baz","foo","baz"])
//=> []
list.intersection(["foo","bar","baz","foo","baz","bob"],["foo","bar","foo"]);
//=> [ 'foo', 'bar' ]
list.diff();
//=> []
list.intersection();
//=> []
list.unique();
//=> []
list.union()
//=> []
Author
Prosen Ghosh [email protected]
License
- MIT : http://opensource.org/licenses/MIT