Another interesting behavior of arguments is that its values always stay in sync with the values of the corresponding named parameters.
.... Because values in the arguments object are automatically reflected by the corresponding named arguments, the change to arguments also changes the value of num2, so both have a value of 10. This doesn’t mean that both access the same memory space, though; their memory spaces are separate but happen to be kept in sync. This effect goes only one way: changing the named argument does not result in a change to the corresponding value in arguments.
I have tried an example of this, and I have found that it does goes the other way too. Changing the value of a named argument, does change the value of the corresponding value in the arguments object.
You can check this example here: https://jsfiddle.net/brsastre/ujc6vhs9/1/
Is there any benefit on using the arguments object rather than the named values, as usual?
The book says:
"...This happens because arguments in ECMAScript are represented as an array internally. there actually is an arguments object that can be accessed while inside a function to retrieve the values of each argument that was passed in." The arguments object acts like an array (though it isn’t an instance of Array) in that you can access each argument using bracket notation.
Is it an array or not?
I doesn't seem to be an object, because I can get the values using arrays notation : arguments
Thanks in advance!