From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../global_objects/function/arguments/index.html | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/function/arguments/index.html (limited to 'files/ja/web/javascript/reference/global_objects/function/arguments/index.html') diff --git a/files/ja/web/javascript/reference/global_objects/function/arguments/index.html b/files/ja/web/javascript/reference/global_objects/function/arguments/index.html new file mode 100644 index 0000000000..4219b3dde1 --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/function/arguments/index.html @@ -0,0 +1,66 @@ +--- +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 +--- +
{{JSRef}} {{deprecated_header}}
+ +

function.arguments プロパティは、関数に渡される引数に対応する、配列風のオブジェクトです。より単純な {{jsxref("Functions/arguments", "arguments")}} 変数を使用してください。このプロパティは厳格モードでは使用できません。

+ +

解説

+ +

function.arguments の構文は非推奨です。関数内で {{jsxref("Functions/arguments", "arguments")}} オブジェクトにアクセスする方法としては、変数 {{jsxref("Functions/arguments", "arguments")}} が利用できます。

+ +

再帰呼び出しの場合、すなわちコールスタックに関数 f が複数回現れる場合に、f.arguments はもっとも直近に実行された関数に対応する引数を表します。

+ +

実行中の関数の未処理の呼び出しがない (つまり、関数が呼び出された状態で返してない) 場合、 arguments プロパティの値は通常 null です。

+ +

+ +

arguments オブジェクトの使用

+ +
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
+
+ +

仕様書

+ +

何れかの標準で定義されたものではありません。 ECMAScript 3 で {{jsxref("Functions/arguments", "arguments")}} に置き換えられました。

+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("javascript.builtins.Function.arguments")}}

+
+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf