DEV Community

Discussion on: Memoization in Javascript

Collapse
 
anishkumar profile image
Anish Kumar • Edited

Yes. WeakMap would be a good choice if you are using objects as keys, it would facilitate better garbage collection in this case. If your keys are strings, using object should be fine.