Higher-Order Functions
Implement Memoize
easyJS SpecificJS / TS4 tests
Problem Statement
Implement a `memoize` function that takes a function `fn` and returns a memoized version that caches results based on arguments stringification.
Examples
Example:
let callCount = 0;
const memoizedFn = memoize((a, b) => { callCount++; return a + b; });
memoizedFn(2, 2); // 4
memoizedFn(2, 2); // 4 (cached, callCount stays 1)JavaScript & TypeScript starter code included
Run this as a live interviewPractice solo
4 test cases. No second person needed.