131
rated 0 times
[
135]
[
4]
/ answers: 1 / hits: 97019
/ 9 Years ago, tue, june 30, 2015, 12:00:00
How do you compare two javascript sets? I tried using ==
and ===
but both return false.
a = new Set([1,2,3]);
b = new Set([1,3,2]);
a == b; //=> false
a === b; //=> false
These two sets are equivalent, because by definition, sets do not have order (at least not usually). I've looked at the documentation for Set on MDN and found nothing useful. Anyone know how to do this?
More From » set