From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../global_objects/function/arguments/index.html | 125 +++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/function/arguments/index.html (limited to 'files/ca/web/javascript/reference/global_objects/function/arguments') diff --git a/files/ca/web/javascript/reference/global_objects/function/arguments/index.html b/files/ca/web/javascript/reference/global_objects/function/arguments/index.html new file mode 100644 index 0000000000..6371caeb23 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/function/arguments/index.html @@ -0,0 +1,125 @@ +--- +title: Function.arguments +slug: Web/JavaScript/Reference/Global_Objects/Function/arguments +translation_of: Web/JavaScript/Reference/Global_Objects/Function/arguments +--- +
{{JSRef}} {{deprecated_header}}
+ +

La propietat function.arguments es refereix a un objecte que s'assembla a una array corresponent als arguments passats a una funció. Utilitzeu la variable simple {{jsxref("Functions/arguments", "arguments")}}.

+ +

Descripció

+ +

La sintaxis function.arguments és obsoleta. El camí recomanat per accedir a l'objecte {{jsxref("Functions/arguments", "arguments")}} disponible en les funcions requereix simplement referir-se a la variable{{jsxref("Functions/arguments", "arguments")}}.

+ +

En cas de recursivitat, és a dir, si la funció f apareix vàries vegades en la pila de crides, el valor det f.arguments representa els arguments corresponents a la invocació més recent de la funció.

+ +

El valor del la propietat arguments normalment és null si no hi ha una invocació excel·lent de la funció (això vol dir, que s'ha cridat la funció però la seva execució encara no s'ha acabat).

+ +

Exemples

+ +
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);
+
+// Resultat
+
+// abans: 1
+// abans: 0
+// després: 0
+// després: 1
+// retorn: null
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES1')}}{{Spec2('ES1')}}Definició inicial. Implementat en JavaScript 1.0. Obsolet a favor de {{jsxref("Functions/arguments", "arguments")}} en ES3.
{{SpecName('ES5.1', '#sec-10.6', 'arguments object')}}{{Spec2('ES5.1')}}{{jsxref("Functions/arguments", "arguments")}} object
{{SpecName('ES6', '#sec-arguments-object', 'arguments object')}}{{Spec2('ES6')}}{{jsxref("Functions/arguments", "arguments")}} object
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterístcaAndroidChrome per AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Vegeu també

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