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 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