It currently reads:
Here we can use calls.push(args) to store all arguments in the log and f.apply(this, args) to forward the call.
function spy(func) {
function wrapper(...args) {
wrapper.calls.push(args);
return func.apply(this, arguments);
}
wrapper.calls = [];
return wrapper;
}
Even though the function works either way, seems like it might be clearer to just have "(this, args)" rather than "(this, arguments)" in the code. Unless the point is to remind us, en passant, that the "arguments" object exists.