Skip to content

isDisjoint

Subhajit Sahu edited this page Dec 2, 2022 · 17 revisions

Check if sets have no value in common.

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


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

var x = new Set([1, 2, 3]);
var y = new Set([3, 4]);
set.isDisjoint(x, y);
// → false

var y = new Set([4]);
set.isDisjoint(x, y);
// → true


References

Clone this wiki locally