Whether A = B
is true
// {1, 2, 3, 4} = {1, 2, 3, 4}
areSetsEqual(new Set([1, 2, 3, 4]), new Set([1, 2, 3, 4])); // true
// {hello, world} = {hello, world}
areSetsEqual(new Set(['hello', 'world']), new Set(['hello', 'world'])); // true
Generated using TypeDoc
Checks if two sets are equal, where two sets have the same number of elements, and same elements themselves
A = B
means∀z, (z ∈ x ⇔ z ∈ y)
O(n)
, wheren = |A|
(size of set A).