Skip to content

Bluefire2/sort-unique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sort unique Build Status Coverage Status

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 process
  • compare: a function that compares two items in the array, returning 1 for greater than, 0 for equal, and -1 for 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;
    }
};

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published