Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

What Is the arguments Object in a Regular Function, and Why Is It Unavailable in Arrow Functions?

In a regular JavaScript function, arguments is an array-like object holding the values passed to that call. Arrow functions create no arguments binding, so the name resolves from the enclosing scope or fails. Rest parameters such as (...args) are the modern replacement.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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:

  • 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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Lexical 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.”

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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:

const collect = (...args) => args;
collect("a", "b"); // ["a", "b"]

To migrate code that used arguments inside a regular function:

  1. Replace the function’s parameter list with a rest parameter, for example function sum() becomes function sum(...nums), or (...nums) => ... if an arrow suits the surrounding code.
  2. Replace arguments.length with nums.length, and indexed reads such as arguments[i] with nums[i].
  3. Remove any Array.prototype.slice.call(arguments) or Array.from(arguments) conversion, because the rest parameter is already an Array.
  4. Keep named parameters that come before the rest parameter, for example (first, ...others). The rest parameter must be last.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.