I came across this piece of code ... where args
is interpreted to fn
args object
... this is really confusing for me, and I couldn't get it
function memoize(fn) {
return function(...args) {
fn.apply(this, args);
}
}
How does the inner function understand that args
passed to it belongs to fn