1.0.2 • Published 5 years ago

array-uniq-x v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

array-uniq-x

Creates a duplicate-free version of an array, using SameValueZero for equality comparisons, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the array.

module.exports*

This method is just a placeholder.

Kind: Exported member
Returns: Array - Returns the new duplicate free array.

ParamTypeDescription
arrayArrayThe array to inspect.
useSameValueBooleanAlternative comparison.

Example

import uniq from 'array-uniq-x';

console.log(uniq([2, 1, 2])); // [2, 1]
console.log(uniq([-0, 0])); // [0]
console.log(uniq([-0, 0], true)); // [-0, 0]