4 ms·
If we use the approach of converting var's to named parameters, we also have to give up on passing variable numbers of arguments to functions. That is, unless w
by rbalicki 11y ago
If we use the approach of converting var's to named parameters, we also have to give up on passing variable numbers of arguments to functions. That is, unless we do something silly like:
function silly(x, y, z, args) {
args = Array.prototype.slice.call(arguments);
args.shift();
args.shift();
args.shift();
args.shift();
x = y = z = undefined;
// regular function goes here
}
- shawndumas 11y agoThe replacement of var or let was a thought experiment to show the actual value--in code--of using them.