---
title: "Comment by Aditya Mitra on \"What is Memoization?\" | Hashnode"
description: "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) loo"
url: "https://hashnode.com/posts/what-is-memoization/621c78b145bf7fc41cc9fb0a/comment/621cd81a085330c3f79c5ddb"
---

[Discussion](https://hashnode.com/posts/what-is-memoization/621c78b145bf7fc41cc9fb0a)

Comment [What is Memoization?](https://hashnode.com/posts/what-is-memoization/621c78b145bf7fc41cc9fb0a)

[Aditya Mitra](https://hashnode.com/@aditya-mitra)

[Feb 28, 2022](https://hashnode.com/posts/what-is-memoization/621c78b145bf7fc41cc9fb0a/comment/621cd81a085330c3f79c5ddb)

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)`?

[Rupert McKay](https://hashnode.com/@fildon)

[Feb 28, 2022](https://hashnode.com/posts/what-is-memoization/621c78b145bf7fc41cc9fb0a/comment/621cd81a085330c3f79c5ddb#reply-621cdce1085330c3f79c5f60)

The lookup time is still constant thanks to hash key lookup. The keys being ordered is a separate part of the same data structure.
