> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# arguments-object

> A function reads the arguments object instead of declaring a rest parameter.

## What it flags

A read of the `arguments` object in a function, method, accessor or constructor without named parameters (including through an arrow function nested inside it), in an ES module, a `.mjs`, `.cjs`, `.mts` or `.cts` file, or any TypeScript file. `arguments` is array-like rather than an array, has no useful type and does not exist in arrow functions. Each function is reported once, at its first use.

It stays quiet for property names such as `call.arguments`, `{ arguments: 1 }` and `const { arguments: args } = call`; for functions that also declare named parameters, where `arguments.length` tells an omitted argument from `undefined` and `super(...arguments)` forwards everything, so a rest parameter would replace the typed signature; for `dataLayer.push(arguments)`, the analytics snippet idiom whose gtag reader needs a real arguments object; for lines under `// eslint-disable-next-line prefer-rest-params` and minified lines; for top-level code; for plain `.js` scripts that are not modules, which may target older runtimes; for files that declare their own `arguments` binding; and for declaration files, generated and vendored code.

## How to review

Declare a rest parameter and use the array:

```ts theme={null}
function sum(...values: number[]) {
  return values.reduce((a, b) => a + b, 0);
}
```

Forwarding with `fn.apply(this, arguments)` becomes `fn.apply(this, args)` or `fn.call(this, ...args)`. There is no automatic fix.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "arguments-object": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.