Skip to content

isDisjoint

Subhajit Sahu edited this page Jun 13, 2020 · 17 revisions

Checks if sets have no common values.

Similar: union, intersection, difference, symmetricDifference, isDisjoint.

set.isDisjoint(x, y);
// x: a set
// y: another set
const map = require('extra-map');

var x = new Map([['a', 1], ['b', 2], ['c', 3]]);
var y = new Map([['c', 3], ['d', 4]]);
map.isDisjoint(x, y);
// false

var y = new Map([['d', 4]]);
map.isDisjoint(x, y);
// true

references

Clone this wiki locally