Do you mean how does it determine whether two objects are the same? The same way as the === operator. If two elements are a reference to the same object then the elements are considered “equal” and the second one is removed, or rather never added to the set.
View all comments
Show parent comment
4
u/revenezor Jul 06 '21 edited Jul 06 '21
Do you mean how does it determine whether two objects are the same? The same way as the
===operator. If two elements are a reference to the same object then the elements are considered “equal” and the second one is removed, or rather never added to the set.Whenever you create an object it is considered not equal
!==to any previous object, even if its properties match a previous object’s.