Home > Article > Web Front-end > A brief discussion on the internal properties of JavaScript functions_Basic knowledge
There are two special attributes inside the function: arguments and this. arguments is an array-like object containing all parameters passed in,
But this object also has an attribute called callee, which is a pointer to the function that owns the arguments object.
Please look at the classic factorial function example:
There is nothing wrong with using the first method, but the coupling is too high, which is not good. After the function name is changed, the internal function name must also change
The second method is low coupling. No matter how the function name changes, it will not affect the function execution.
This refers to the environment object in which the function data is executed, or it can also be said to be the this value
The caller attribute holds the reference of the function that calls the current function. If the current function is called in the global scope, its value is Null
The above is all the content of the internal properties of javascript functions. I hope you guys like it