Skip to content

Instantly share code, notes, and snippets.

@johntran
Created December 17, 2017 01:30
Show Gist options
  • Save johntran/f1f5a0e757c333f712510e59fb6ce85b to your computer and use it in GitHub Desktop.
Save johntran/f1f5a0e757c333f712510e59fb6ce85b to your computer and use it in GitHub Desktop.
/**
https://lodash.com/docs/4.17.4#memoize
Create a function that saves previous results of past calls.
Example:
function add(x,y) {
return x + y
}
const memoizedAdd = memoize(add);
memoizedAdd(1,2) returns 3;
memoizedAdd(2,3) returns 5;
memoizedAdd(1,2) returns 3, but never called add to figure that out.
*/
function memoize(func) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment