Protect your apps from supply chain attacksInstall
Removes all duplicates from an array in place.
First install using npm:
npm install uniq
Then use it as follows:
var arr = [1, 1, 2, 2, 3, 5] require("uniq")(arr) console.log(arr) //Prints: // // 1,2,3,5 //
require("uniq")(array[, compare, sorted])
Removes all duplicates from a sorted array in place.
arrayis the array to remove items from
compareis an optional comparison function that returns 0 when two items are equal, and something non-zero when they are different. If unspecified, then the default equals will be used.
sortedif true, then assume array is already sorted
Returns: A reference to
O(array.length * log(arra.length)) or
A few reasons:
(c) 2013 Mikola Lysenko. MIT License
Removes duplicates from a sorted array in place
The npm package uniq receives a total of 5,019,750 weekly downloads. As such, uniq popularity was classified as popular.
We found that uniq demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.