JS: Function arguments Object
arguments
is a builtin variable, available in
function body defined using the keyword
function
.
(it is not in Arrow Function)
- The
arguments
object is a Array-Like Object. - Each slot is the value of argument, when a function is called.
function ff() { return arguments; } console.log(ff("a", "b")); // { "0": "a", "1": "b" } console.log(Array.isArray(ff()) === false);
π‘ TIP: never use the argument object. Always declare function parameters. It makes your code readable. If needed, use JS: Function Rest Parameters .
JavaScript, Function
- JS: Define Function
- JS: Arrow Function
- JS: Function Parameters
- JS: arguments Object
- JS: Function Rest Parameters
- JS: Function Argument Default Value
- JS: Function Argument Destructure
- JS: Function Declaration vs Function Expression
- JS: Closure
- JS: Function Call, Apply, Bind
- JS: Functional Programing
- JS: Function Pipe π
- JS: Function Object
- JS: Function Constructor
- JS: Function.prototype