Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
length は Function インスタンスのプロパティで、関数が期待する引数の数を示します。
数値です。
| 書込可能 | 不可 |
| 列挙可能 | 不可 |
| 設定可能 | 可 |
Function オブジェクトの length プロパティは、関数が期待する引数の数、つまり形式上の引数の数を示します。
これに対し、 arguments.length は関数のローカルスコープ内で用いられ、関数が実際に受け取った引数の数、つまり実引数の数を参照するのに用いるものです。
Function コンストラクター自体は、 Function オブジェクトです。この length データプロパティの値は 1 です。
歴史的な理由により、 Function.prototype は自身を呼び出すことができます。 Function.prototype の length は 0 の値を持ちます。
| ECMAScript® 2027 Language Specification # sec-function-instances-length |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年9月18日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.