-
Notifications
You must be signed in to change notification settings - Fork 5
isDisjoint
wolfram77 edited this page Apr 11, 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)
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