JS: arguments (object)
arguments
is a builtin variable, available in function body defined using the keywordfunction
.arguments
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 Parameter Default Value
- JS: Function Argument Destructure
- JS: Function. Declaration vs Expression
- JS: Closure
- JS: Function Call, Apply, Bind
- JS: Functional Programing
- JS: Function Pipe 📜
- JS: Function (class)
- JS: Function Constructor
- JS: Function.prototype