What is arguments?
Arguments is a similar array that is created when a function is called, but is not an array object, and it stores the arguments that are actually passed to the function, and is not limited to the argument list of the function declaration.
What do you mean, "ni"?
Write a demo, see the code.
Run the code, through the Chrome debugger, you can get the following figure
I use instanceof to judge arguments, from the effect of printing, arguments is an object.
then expand the print out of the arguments, you can learn from the above, it contains a number of properties, Callee also.
Next, we modify the code above to pass arguments to it when the obj function is called, but the obj function has no arguments.
See below for specific code
Using the Chrome debugger, you can get the image below
As you can see, arguments contains three parameters we pass to it "monkey", "Love", 24.
So, why is arguments a parameter stored that is actually passed to a function instead of a function declaration?
What is callee?
Callee is a member of the arguments object whose value is "the function object being executed."
What does that mean?
Let's write a demo and see how the output turns out.
Code and result graphs see below
From the picture above, Arguments.callee is the function that points to the arguments object of the parameter, here is obj.
What is caller?
Caller is a property of a function object that holds the function that calls the current function.
Note that is called. Not just closures. Null if there is no parent function.
Still the same as usual, we have been to write a demo to see.
The code is as follows:
Open the Chrome debugger to get a picture of the effect
Combining the code and the above figure understanding, does this understand caller?