首页 > 代码库 > javascript函数库

javascript函数库

//构造缓存函数var memoizer = function (memo, fundamental) {    var shell = function (n) {        var result = memo[n];        if (typeof result !== ‘number‘) {            result = fundamental(shell, n);            memo[n] = result;        }        return result;    };    return shell;};

 

javascript函数库