© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Aditya Mitra
Bigger the problem, better the solution
Great Article! Loved the 4 points for what should not be memoized
Just curious - JS Map orders the keys in manner of insertion. Does it actually give a O(1) lookup or O(logn)?
Map
O(1)
O(logn)
Rupert McKay
Staff Software Engineer at Lokalise
The lookup time is still constant thanks to hash key lookup. The keys being ordered is a separate part of the same data structure.