JavaScript: Function's β€œarguments” Object

By Xah Lee. Date: . Last updated: .

arguments is a builtin variable, available in function body defined using 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: you should never use the argument object. Always declare function parameters. It makes your code readable. If needed, use JavaScript: Function Rest Parameters .

JavaScript Function

BUY
Ξ£JS
JavaScript in Depth

JavaScript in Depth

Basic Syntax

Value Types

Variable

String

Property

Object and Inheritance

Array

Function

Constructor/Class

Iterable 🌟

Misc