本次函数调用时传入函数的实参数量.

## Syntax

    arguments.length

## 描述

arguments.length表示的是实际上向函数传入了多少个参数,这个数字可以比形参数量大,也可以比形参数量小(形参数量的值可以通过Function.length获取到).

## 例子

### 例子: 使用`arguments.length`

这个例中,我们定义了一个可以相加任意个数字的函数.

    function adder(base, /*, n2, ... */) {
      base = Number(base);
      for (var i = 0; i < arguments.length; i++) {
        base += Number(arguments[i]);
      }
      return base;
    }

## Specifications

Specification | Status | Comment
--- | --- | ---
ECMAScript 1st Edition (ECMA-262) | Standard | Initial definition. Implemented in JavaScript 1.1
ECMAScript 5.1 (ECMA-262) Arguments Object | Standard |
ECMAScript 2015 (6th Edition, ECMA-262) Arguments Exotic Objects | Standard |
ECMAScript Latest Draft (ECMA-262) Arguments Exotic Objects | Draft |

## 浏览器支持

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

Update compatibility data on GitHub

| Desktop | Mobile | Server
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | Safari on iOS | Samsung Internet | Node.js
`length` | Chrome Full support Yes | Edge Full support Yes | Firefox Full support 1 | IE Full support Yes | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Edge Mobile Full support Yes | Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes | nodejs Full support Yes

### Legend

Full support
  Full support

## 相关链接

- Function.length