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

2.10.19 • Public • Published

Checks if arrays have no value in common. 📦 😺 🏃 📼 🌔 📜 📰 📘

Similar: isUnique, isDisjoint, intersection.

This is part of package extra-array.

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


array.isDisjoint(x, y, [fc], [fm]);
// x:  an array
// y:  another 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, 3, 4];
array.isDisjoint(x, [2, 5]);
// false

array.isDisjoint(x, [-2, -5]);
// true

array.isDisjoint(x, [-2, -5], (a, b) => Math.abs(a) - Math.abs(b));
// false

array.isDisjoint(x, [-2, -5], null, v => Math.abs(v));
// false


References

Package Sidebar

Install

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

Weekly Downloads

0

Version

2.10.19

License

MIT

Unpacked Size

6.81 kB

Total Files

8

Last publish

Collaborators

  • wolfram77