-
Notifications
You must be signed in to change notification settings - Fork 1
isDisjoint
wolfram77 edited this page Mar 27, 2020
·
25 revisions
Checks if arrays have no value in common.
array.isDisjoint(x, y, [fn]);
// x: an array
// y: another array
// fn: compare function (a, b)
// --> true if disjoint
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