News for hackers. Stuff that matters.
Re:New JavaScript Set Methods by Fishkins on Monday June 24, 2024 @10:42AM (#40776651)
According to the Mozilla docs, O(n) lookups would actually violate the spec [0]. As a sibling comment says, a tree set is one option to satisfy the spec. Another is a linked hash set, which would have O(1) lookups [1].

0: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

1: https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHa...

There are no comments on this comment yet.