Recommended Free Tools
In a regular (non-arrow) JavaScript function, arguments is an array-like object containing every value passed in that particular call. Arrow functions do not create an arguments object of their own. A bare reference to arguments inside an arrow is resolved from the surrounding lexical scope: it reads an enclosing regular function’s arguments if one exists, and otherwise fails with a ReferenceError. If you want to collect the arguments of an arrow function, declare a rest parameter such as (...args).
What the arguments object is in a regular function
When you call a regular function, JavaScript provides an arguments binding that belongs to that invocation. It holds the actual values supplied at the call site, whether or not the function declares parameters for them. Each call gets its own object, so recursive or repeated calls do not share one.
As an Amazon Associate I earn from qualifying purchases.
Indexed access starts at zero, and arguments.length counts the values that were passed, not the number of declared parameters. The distinction matters: a function declared as function f(a, b) and called as f(1) has arguments.length equal to 1, while b is undefined.
It is array-like, not an Array
The object has numeric indexes and a length property, which makes it array-like, but it is not an Array. It does not inherit Array methods such as map(), forEach(), or filter(), so calling them directly fails. Two conversions are common:
#1 Best Overall
Array.from(arguments)produces a real array from any array-like value.[...arguments]spreads the iterable into a new array. This works because the object is iterable.
Both copy the values. Neither gives you a live view that behaves like an Array afterward.
Why arrow functions do not have their own arguments
Arrow functions intentionally skip creating an arguments binding. The ECMAScript 2015 Language Specification (published by Ecma International) states this in a single sentence: “Arrow functions never have an arguments objects.” The MDN Web Docs reference pages for the arguments object and for arrow function expressions, checked in October 2026, describe the same behavior.
Rank #2
The practical model is lexical inheritance. An arrow function looks up identifiers the way it looks up anything else: first in its own parameters and local declarations, then outward through the enclosing scopes. Arrow functions already work this way for this, and arguments follows the same rule.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsLexical lookup: when an arrow can read arguments
An arrow nested inside a regular function can use that function’s arguments:
function outer(value) {
const read = () => arguments[0];
return read();
}
outer("hello"); // "hello"
The arrow read does not have its own arguments, so the reference resolves to outer‘s object. Because read is called during outer‘s execution, the value is the one outer received.
When the name cannot be resolved
If no enclosing scope supplies an arguments binding, a bare reference inside an arrow fails. This is an ordinary unresolved identifier, so it throws a ReferenceError. That is the usual symptom when someone converts a method to an arrow function and suddenly gets “arguments is not defined.”
Rank #4
Top-level code is the case that varies by environment. A top-level arrow has no arrow-local binding, but the host can provide an outer one. Some runtimes wrap module code in a function that supplies its own arguments, so the same line may work in one place and throw in another. In environments without such a wrapper, it throws. Do not rely on top-level arguments in code meant to run across browsers, bundlers, and Node.js module types.
Collecting arguments in an arrow function
The clean replacement is a rest parameter. It is declared explicitly, works in both regular and arrow functions, and produces a real Array:
Best Value
const collect = (...args) => args;
collect("a", "b"); // ["a", "b"]
To migrate code that used arguments inside a regular function:
- Replace the function’s parameter list with a rest parameter, for example
function sum()becomesfunction sum(...nums), or(...nums) => ...if an arrow suits the surrounding code. - Replace
arguments.lengthwithnums.length, and indexed reads such asarguments[i]withnums[i]. - Remove any
Array.prototype.slice.call(arguments)orArray.from(arguments)conversion, because the rest parameter is already an Array. - Keep named parameters that come before the rest parameter, for example
(first, ...others). The rest parameter must be last.
Mapped arguments: a qualification older examples skip
Some older explanations suggest that arguments[0] and the first named parameter always stay linked. That holds only for non-strict functions whose parameter lists are simple identifiers. In that case, assigning to one updates the other:
function f(a) {
arguments[0] = 9;
return a;
}
f(1); // 9 in non-strict code
In strict mode, the same function returns 1. The link is also absent when the function uses rest parameters, default values, or destructuring in its parameter list. Do not write code that depends on this synchronization; it is a historical edge case that the modern pattern avoids entirely.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Comparing the two approaches
| Feature | arguments in a regular function |
Rest parameter (...args) |
|---|---|---|
| Available in arrow functions | Not as their own binding; an arrow reads an enclosing regular function’s object or throws ReferenceError |
Yes, declared explicitly |
| Data shape | Array-like; no Array methods until converted | A real Array |
| Declaration needed | None; created automatically for regular functions | Must be written in the parameter list |
| Linked to named parameters | Only in non-strict functions with simple parameter lists | Never |
| Best use | Reading or maintaining older code | New variadic functions |
For new code, declare rest parameters. Read arguments when you encounter it in older code, and convert it with Array.from or spread when you need array methods.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




