12345678910111213141516171819202122232425262728293031323334 |
- "use strict";
- const memoize = fn => {
- let cache = false;
-
- let result = undefined;
- return () => {
- if (cache) {
- return (result);
- } else {
- result = fn();
- cache = true;
-
-
-
-
- fn = undefined;
- return (result);
- }
- };
- };
- module.exports = memoize;
|