hard20 pts · first answer countshash-mapjavascriptmemoization
Memo cache misses for equal arguments
A memoize helper uses JSON.stringify(args) as the cache key. f({ a: 1, b: 2 }) and f({ b: 2, a: 1 }) both compute from scratch. Why?
Discussion 0
Join free to post in the discussion.
Related questions
- fetch treats a 404 as successBackend Developer
- slice vs spliceBackend Developer
- indexOf and NaNBackend Developer
- new Array(3) then mapBackend Developer
- Value missing from indexOfBackend Developer
- parseInt on a CSS valueBackend Developer
- Number of an empty form fieldBackend Developer
- Checking whether a value is an arrayBackend Developer