Hacker News new | ask | show | jobs
by Fishkins 727 days ago
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...