@f/unique
v1.0.1
Published
Return the unique elements of a list
Downloads
11
Readme
unique
Return the unique elements of a list
Installation
$ npm install @f/unique
Usage
var unique = require('@f/unique')
unique([1,2,3,3]) // -> [1, 2, 3]
unique(['c', 'a', 'c']) // -> ['c', 'a']
API
unique(arr, cmp?)
arr
- Array of valuescmp
- Optional comparator to determine uniqueness
Returns: An array containing each unique value in arr
exactly once.
License
MIT