Some More Theory
Now that you are aware of the existence of arrays and objects, I can clarify a few issues that were glossed over before.
The arguments Object
Whenever a function is called, a special “magic” variable named arguments is added to the environment in which the function body runs. This
variable refers to an object that resembles an array. It has a property 0 for the first argument, 1 for the second, and so on, for
every argument the function was given. It also has a length
property.
However, the arguments object is not a real array—it does not have
methods like push, and it does not automatically update its length property when you add something to it. This is an unfortunate heritage of the haphazard way in which the language has grown. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access