Created
December 17, 2017 01:30
-
-
Save johntran/f1f5a0e757c333f712510e59fb6ce85b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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