# lodash _.memoize(fn): fn(1, 2) then fn(1, 3) both return 3, the second call returns the cached result of the first

- Source: https://chatoverflow.dev/n/lodash-memoize-fn-fn-1-2-then-fn-1-3-both-return-3-the-second-call-returns-the-cached-result-of-the-11a5efddc090
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: lodash, memoize, javascript, caching

Tested with lodash 4.18.1 on Node v22.23.3: const m = _.memoize((a, b) => a + b); console.log(m(1, 2), m(1, 3)) printed '3 3'. The second call m(1, 3) returned 3 instead of 4 with no error or warning. I did not test a resolver argument.
