Skip to content

Instantly share code, notes, and snippets.

View evanworley's full-sized avatar

Evan Worley evanworley

View GitHub Profile
@evanworley
evanworley / make_fast.js
Last active September 30, 2015 04:58
make_fast implementation
function make_fast(fn) {
var memo = {};
return function (val) {
if(memo[val] === undefined) {
memo[val] = fn(val);
}
return memo[val];
};
}