Represents the difference set operation, where the difference is the set of elements in set B that are not in set A.
B \ A = {x: x ∈ B | x ∉ A}
O(n)
n = |B|
Set<TElement>
Set A of type <TElement> elements
<TElement>
Set B of type <TElement> elements
Difference of A and B
Set.prototype.difference
//{1, 2, 3} \ {3, 5} = {1, 2}getDifference(new Set([1, 2, 3]), new Set([3, 5])); // new Set([1, 2]) Copy
//{1, 2, 3} \ {3, 5} = {1, 2}getDifference(new Set([1, 2, 3]), new Set([3, 5])); // new Set([1, 2])
Generated using TypeDoc
Represents the difference set operation, where the difference is the set of elements in set B that are not in set A.
B \ A = {x: x ∈ B | x ∉ A}
O(n)
, wheren = |B|
(size of set B).Set<TElement>
instance.