--- title: Function.arguments slug: Web/JavaScript/Reference/Global_Objects/Function/arguments tags: - Deprecated - Function - JavaScript - Property - arguments translation_of: Web/JavaScript/Reference/Global_Objects/Function/arguments --- <div>{{JSRef}} {{deprecated_header}}</div> <p><code><strong><em>function</em>.arguments</strong></code> プロパティは、関数に渡される引数に対応する、配列風のオブジェクトです。より単純な {{jsxref("Functions/arguments", "arguments")}} 変数を使用してください。このプロパティは厳格モードでは使用できません。</p> <h2 id="Description" name="Description">解説</h2> <p><code><em>function</em>.arguments</code> の構文は非推奨です。関数内で {{jsxref("Functions/arguments", "arguments")}} オブジェクトにアクセスする方法としては、変数 {{jsxref("Functions/arguments", "arguments")}} が利用できます。</p> <p>再帰呼び出しの場合、すなわちコールスタックに関数 <code>f</code> が複数回現れる場合に、<code>f.arguments</code> はもっとも直近に実行された関数に対応する引数を表します。</p> <p>実行中の関数の未処理の呼び出しがない (つまり、関数が呼び出された状態で返してない) 場合、 arguments プロパティの値は通常 null です。</p> <h2 id="Example" name="Example">例</h2> <h3 id="Using_the_arguments_object" name="Using_the_arguments_object">arguments オブジェクトの使用</h3> <pre class="brush: js notranslate">function f(n) { g(n - 1) } function g(n) { console.log('before: ' + g.arguments[0]) if (n > 0) { f(n) } console.log('after: ' + g.arguments[0]) } f(2) console.log('returned: ' + g.arguments) // Output // before: 1 // before: 0 // after: 0 // after: 1 // returned: null </pre> <h2 id="Specifications" name="Specifications">仕様書</h2> <p><span class="pl-s">何れかの標準で定義されたものではありません。</span> ECMAScript 3 で {{jsxref("Functions/arguments", "arguments")}} に置き換えられました。</p> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <div> <div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div> <p>{{Compat("javascript.builtins.Function.arguments")}}</p> </div> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li>{{jsxref("Functions/arguments", "arguments")}} オブジェクト</li> <li>{{jsxref("Functions", "関数と関数スコープ", "", 1)}}</li> </ul>