JavaScript: Function's “arguments” Object

By Xah Lee. Date: . Last updated: .

There's a predefined variable named arguments in function defined using keyword function. The arguments object is a Array-Like Object. Each slot is the value of argument.

function ff() {
    return arguments; // return the arguments object
}

console.log(
 ff(3,4,5)
);
// { '0': 3, '1': 4, '2': 5 }

「arguments」 is Array-Like Object

// “arguments” is a array-like object

function ff() {
    return Array.isArray(arguments);
}

console.log( ff() ); // false

JavaScript Function

BUY
ΣJS
JavaScript in Depth

JavaScript in Depth

Basic Syntax

Value Types

Variable

String

Function

Property

Object and Inheritance

Array

Constructor/Class

Iterable 🌟

Misc