The arguments Object
You can also set the arguments using the arguments object. The following code will set the first argument to 1:
- length – the number of arguments received by the function
- callee – the currently executing function
arguments Use Examples
Another example can be declaring an API function that might get an argument to set some element’s value or else it returns the element’s value:
If the webpage has a elm textbox the value of the textbox will be logged and then changed to “Hello”.