1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
---
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>Die <code><strong><em>function</em>.arguments</strong></code> Eigenschaft referenziert ein Array ähnliches Objekt, welches die übergebenen Parameter einer Funktion enthält. Stattdessen kann die Variable {{jsxref("Functions/arguments", "arguments")}} benutzt werden. Diese Eigenschaft ist im Strict Mode aufgrund von <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-addrestrictedfunctionproperties">taill Aufrufoptimierung</a> verboten.</p>
<h2 id="Beschreibung">Beschreibung</h2>
<p>Die Syntax <code><em>function</em>.arguments</code> ist veraltet. Der empfolene Weg, um das {{jsxref("Functions/arguments", "arguments")}} Objekt zu erreichen, ist in einer Funktion die Variable {{jsxref("Functions/arguments", "arguments")}} zu benutzen.</p>
<p>Im Fall von Rekursion, z. B. wenn die Funktion <code>f</code> mehrere Male auf dem Aufruf-Stack ist, repräsentiert <code>f.arguments</code> die Argumente des letzten Aufrufes der Funktion.</p>
<p>Der Wert der <code>arguments</code> Eigenschaft ist normalerweise <code>null</code>, wenn keine Durchführung der Funktion vorhanden ist (Durchführung bedeutet, dass die Funktion aufgerufen wurde, aber noch nichts zurückgegeben hat).</p>
<h2 id="Beispiele">Beispiele</h2>
<pre class="brush: js">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="Spezifikationen">Spezifikationen</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Spezifikation</th>
<th scope="col">Status</th>
<th scope="col">Kommentar</th>
</tr>
<tr>
<td>{{SpecName('ES1')}}</td>
<td>{{Spec2('ES1')}}</td>
<td>Initiale Definition. Implementiert in JavaScript 1.0. Deprecated zugunsten von {{jsxref("Functions/arguments", "arguments")}} in ES3.</td>
</tr>
<tr>
<td>{{SpecName('ES5.1', '#sec-10.6', 'arguments object')}}</td>
<td>{{Spec2('ES5.1')}}</td>
<td>{{jsxref("Functions/arguments", "arguments")}} Objekt</td>
</tr>
<tr>
<td>{{SpecName('ES6', '#sec-arguments-object', 'arguments object')}}</td>
<td>{{Spec2('ES6')}}</td>
<td>{{jsxref("Functions/arguments", "arguments")}} Objekt</td>
</tr>
<tr>
<td>{{SpecName('ESDraft', '#sec-arguments-object', 'arguments object')}}</td>
<td>{{Spec2('ESDraft')}}</td>
<td>{{jsxref("Functions/arguments", "arguments")}} Objekt</td>
</tr>
</tbody>
</table>
<h2 id="Browserkompatibilität">Browserkompatibilität</h2>
<div>
<p>{{Compat("javascript.builtins.Function.arguments")}}</p>
</div>
<h2 id="Siehe_auch">Siehe auch</h2>
<ul>
<li>{{jsxref("Functions/arguments", "arguments")}} object</li>
<li>{{jsxref("Functions", "Funktionen und Funktionsscopes", "", 1)}}</li>
</ul>
|