@extra-array/is-unique.min
TypeScript icon, indicating that this package has built-in type declarations

2.10.19 • Public • Published

Checks if there are no duplicate values. 📦 😺 🏃 📼 🌔 📜 📰 📘

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 array_isUnique.
CDN: unpkg, jsDelivr.


array.isUnique(x, [fc], [fm]);
// x:  an array
// fc: compare function (a, b)
// fm: map function (v, i, x)

⏱️ 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

Package Sidebar

Install

npm i @extra-array/is-unique.min

Weekly Downloads

1

Version

2.10.19

License

MIT

Unpacked Size

6.53 kB

Total Files

8

Last publish

Collaborators

  • wolfram77