Loading...
if (a.isDisjointFrom(b)) {
warn('Sets overlap');
}if (!a.isDisjointFrom(b)) {
warn('Sets overlap');
}isDisjointFrom() returns true when there is no overlap, so the warning needs the negation.
isDisjointFrom() backwards and treating true as 'they overlap'.Set or set-like object with size, has() and keys(), not a plain array.true means the sets have no values in common.![...a].some((x) => b.has(x)).isDisjointFrom() better than intersection().size === 0?Usually yes. It can stop at the first shared value and does not build a new set.
isDisjointFrom() return for an empty Set?true. An empty set shares no values with any set.