What does writing to arguments[0] do to the parameter in each of these functions?
function sloppy(a) {
arguments[0] = 99;
return a;
}
function strict(a) {
"use strict";
arguments[0] = 99;
return a;
}
function withDefault(a = 0) {
arguments[0] = 99;
return a;
}
function missing(a) {
arguments[0] = 99;
return a;
}
console.log(sloppy(1), strict(1), withDefault(1), missing());
The answer
Work out every line it logs, in order. Then check.
Checking your sign-in…