- The source code examples in this post are on Github
1.1 - A basic example of the call object
The call object or activation object if you prefer is created when a function is called. It is populated with the arguments object, as well as named arguments for the function, and any local variables that are defined with a keyword such as var, let, or const within the body of the function.
This example shows just about everything there is to be aware of when it comes to the call object. In a nut shell the call or activation object refers to arguments, the arguments object, and any local variables defined in the body of the function. The values of the properties of the call object depend on the values that are passed at the time that the function was called, and any additional logic inside the body of the function as well as the current values of any additional global variables that are used as well.
1.2 - The function call prototype method
The call method of the function prototype is one of a few function prototype methods that can be used to change what the value of the this keyword is in the body of a Class prototype method. This includes built in prototype methods like the for each method of the array prototype.
2 - Values of the call object can be affected by globals
For developers that are keen with the practices associated with functional programing it is frowned upon to do so as what I am covering in this section is not consistent with the nature of pure functions. However never the less it is possible to set the values of the local variables of the call object within the body of a function depending the the current value of global variables outside the body of that function.
To make functions in line with functional programing, globals should be passed as arguments when calling the function. In addition to that noting else inside the body of the function or outside of it should have an effect on the end result aside from what is given by way of the functions arguments.
3 - Conclusion
So in other words the call object is something that is also often called local variables. That is local variables that are local to the body of a function and are then at the front of the scope chain. A call object is created each time a function is called and it contains the current state of arguments that where passed when it was called along with any local variables that are defined within the body of the function, and the arguments object.