@extra-array/is-unique.min

Checks if there are no duplicate values.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-array/is-unique.min
1412.10.198 months ago3 years agoMinified + gzip package size for @extra-array/is-unique.min in KB

Readme

Checks if there are no duplicate values. :package: :smileycat: :running: :vhs: :moon: :scroll: :newspaper: :bluebook:
Similar: isUnique, isDisjoint, intersection.

This is part of package extra-array.

This is browserified, minified version of @extra-array/is-unique.
It is exported as global variable arrayisUnique.
CDN: unpkg
, jsDelivr.



array.isUnique(x, [fc], [fm]);
// x:  an array
// fc: compare function (a, b)
// fm: map function (v, i, x)
:stopwatch: Compare function => O(n²).

const array = require("extra-array");

var x = [1, 2, -1, -2];
array.isUnique(x);
// true

array.isUnique(x, (a, b) => Math.abs(a) - Math.abs(b));
// false

array.isUnique(x, null, v => Math.abs(v));
// false



References