array-uniq-x

1.0.2 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

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.

Param Type Description
array Array The array to inspect.
[useSameValue] Boolean Alternative 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]

Package Sidebar

Install

npm i array-uniq-x

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

609 kB

Total Files

17

Last publish

Collaborators

  • xotic750