| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set/isDisjointFrom | [Back] [Original] |
Get to know MDN better
isDisjointFrom(other)
other true false
A B AB=A\text{ }B \text{ } \Leftrightarrow A\cap B = \empty
isDisjointFrom() other this Set this this other
this other.size other keys() other other this false keys() return() truethis e other.has(e) false trueisDisjointFrom() this other
20 20 1
const primes = new Set([2, 3, 5, 7, 11, 13, 17, 19]);
const squares = new Set([1, 4, 9, 16]);
console.log(primes.isDisjointFrom(squares)); // true
20 20 1
const composites = new Set([4, 6, 8, 9, 10, 12, 14, 15, 16, 18]);
const squares = new Set([1, 4, 9, 16]);
console.log(composites.isDisjointFrom(squares)); // false
| ECMAScript 2027 LanguageSpecification # sec-set.prototype.isdisjointfrom |
SetSet.prototype.add()Set.prototype.clear()Set.prototype.delete()Set.prototype.difference()Set.prototype.entries()Set.prototype.forEach()Set.prototype.has()intersection()Set.prototype.isDisjointFrom()isSubsetOf()isSupersetOf()Set.prototype.keys()symmetricDifference()Set.prototype.union()Set.prototype.values()Set.prototype[Symbol.iterator]()Object/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()| Web Proxy Viewer | New URL | Original Page |