2 ms·
I really miss the simpler times of ES3/5. function memoize = function (fn) { var value return function() { return value !== und
by ricardobeat 8y ago
I really miss the simpler times of ES3/5.
function memoize = function (fn) {
var value
return function() {
return value !== undefined ? value : (value = fn())
}
}
var func = memoize(someComputation)
Why would anyone want to write that do/iife abomination inline?