Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.
/ list-unique Public archive

JavaScript Package for Creating an array without duplicates

License

Notifications You must be signed in to change notification settings

Prosen-Ghosh/list-unique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

list-unique

JavaScript Package for Creating an array without duplicates

npm license github-issues

nodei.co

travis-status stars forks

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 prosenghosh25@gmail.com

License

About

JavaScript Package for Creating an array without duplicates

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published