Re:New JavaScript Set Methods
by postalrat on Monday June 24, 2024 @04:47PM
(#40780558)
You can use objects and other things as keys for a Set or Map. As far as I know you can't do that for objects.
I've also seen Map perform faster than using an object as a Map.
[ Parent
| on HN ]
Re:New JavaScript Set Methods
by brobdingnag_pp on Monday June 24, 2024 @05:36PM
(#40781098)
Beware of a gotcha here: object keys are tested for strict equality and not deep equality, in other words add/get must use the same object instance and not just an object with the same keys/values