sort-unique
v1.0.0
Published
Sorts an array, removing all duplicate elements
Downloads
20
Readme
Sort unique

Sort unique is a package that sorts an array and removes all duplicate elements (without modifying the original array).
Installation
You can download and install this package from NPM with npm i -S sort-unique.
require('sort-unique')(array[, compare])
Sorts an array and removes all duplicates.
array: the array to processcompare: a function that compares two items in the array, returning1for greater than,0for equal, and-1for less than.
If compare is unspecified, it will default to
(a, b) => {
if (a > b) {
return 1;
} else if (a < b) {
return -1;
} else {
return 0;
}
};