JS: Function arguments Object

By Xah Lee. Date: . Last updated: .

arguments is a builtin variable, available in function body defined using the keyword function. (it is not in Arrow Function)

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

BUY Ξ£JS JavaScript in Depth