let computeCount = 0;
const memoDouble = memoize(x => { computeCount++; return x * 2; });
memoDouble(5); memoDouble(5);
computeCount; // 1 β computed only onceThe underlying function is called only once per unique input β subsequent calls hit the cache.
Memoization should call the original function only once per unique input. Subsequent calls with the same input use the cache.
Challenge: Verify that a memoized function calls the underlying function only once for each unique argument.