Let’s understand the specific difference between arguments and arguments.callee through an example:
The code is as follows:
Calling method:
Copy code
The result after running is:
Copy code
wrong number of arguments: expected: 3; actually passed2
NaN
My understanding:
arguments is the calling object, which is the object that calls this method
arguments.callee is the current object, which actually returns the currently executed function object
Through this example, we can see that
arguments actually refers to the function "f(1,2)"
argument.callee actually refers to "function f(x,y,z){}"