isDisjoint - nodef/extra-array GitHub Wiki
Examine if arrays have no value in common.
Similar: isUnique, isDisjoint, intersection.
function 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 xarray = require('extra-array');
var x = [1, 2, 3, 4];
xarray.isDisjoint(x, [2, 5]);
// ā false
xarray.isDisjoint(x, [-2, -5]);
// ā true
xarray.isDisjoint(x, [-2, -5], (a, b) => Math.abs(a) - Math.abs(b));
// ā false
xarray.isDisjoint(x, [-2, -5], null, v => Math.abs(v));
// ā false