# 02.ii Arguments object

В теле функции есть специальный идентификатор `arguments` (неявный объект), который ссылается на объект `Arguments`, присутствующий в вызове каждой функции. Объект `Arguments` – это объект, подобный массиву, позволяющий извлекать переданные функции значения по их номерам, а не по именам. JavaScript-функции при помощи `arguments` могут быть написаны таким образом, чтобы работать с *любым* количеством аргументов.

Основные свойства:

* Элементы массива `arguments` позиционно соответствуют переданным аргументам в функцию.
* В нестрогом режиме изменяя значение в `arguments` меняется и значение локальной переменной. В строгом это запрещено.
* Свойство `arguments.length` определяет количество аргументов фактически переданных при вызове функции (стоит отличать от свойства `length` самой функции - там это число параметров).
* Начиная c ES6 `arguments` является итерируемым.

```javascript
function foo() {
  const obs = merge(arguments);
  ...
}
```

В ES6 стоит использовать оператор `spread` вместо `arguments`. Заметим, что `rest` — настоящий массив, с методами `map`, `forEach` и другими, в отличие от `arguments`.

```javascript
function showName(firstName, lastName, ...rest) {
  ...
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://strctr.gitbook.io/programming/01-languages/javascript/01-language/c-functions/c1-functions/02.ii-function-arguments-object.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
