Skip to content
Advertisement

implement a memoization function in JavaScript [closed]

The function that I need to implement should take a function to memoize, then return a new function that remembers the inputs to the supplied function.

This is an exercise, for such is not required for the memoize function to remember all previous values, just the last input value, and the function return.

JavaScript

The actual code is not capable of accessing the previous values that I’m trying to record.

Advertisement

Answer

probably you’re looking for something like this:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement