Intermediate
JavaScript
Q48 / 100
What is memoization?
Correct! Well done.
Incorrect.
The correct answer is B) Caching a function's result for given inputs so repeated calls with the same inputs return the cached result
B
Correct Answer
Caching a function's result for given inputs so repeated calls with the same inputs return the cached result
Explanation
Memoization trades memory for speed. const memo = {}; if (memo[n]) return memo[n]; ... memo[n] = result; return result;
Progress
48/100