Consider this JavaScript function:
var f = function (a) { console.log(a+" "+arguments[0]); a = 3; console.log(a+" "+arguments[0]); }
I would expect a and arguments[0] refer to the same value only up to the second function statement. Instead, they always refer to the same value: f(2) calls
2 2 3 3
and f({foo: 'bar'}) calls:
[object Object] [object Object] 3 3
Argument identifiers and arguments identifier are associated in a special way?
javascript
Eric
source share