-
Notifications
You must be signed in to change notification settings - Fork 0
isDisjoint
Subhajit Sahu edited this page Jun 19, 2020
·
1 revision
Examine if arrays have no value in common.
Similar: [isUnique], isDisjoint, [intersection].
function isDisjoint(x, y, fc, fm)
// x: a sorted array
// y: another sorted array
// fc: compare function (a, b)
// fm: map function (v, i, x)
const xsortedArray = require('extra-sorted-array');
var x = [10, 20, 20, 40, 40, 80];
var y = [20, 50, 70];
xsortedArray.isDisjoint(x, y);
// → false
var z = [30, 60, 90];
xsortedArray.isDisjoint(x, z);
// → true