From a55b575e8089ee6cab7c5c262a7e6db55d0e34d6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:46:50 +0100 Subject: unslug es: move --- .../functions/arguments/length/index.html | 131 +++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 files/es/web/javascript/reference/functions/arguments/length/index.html (limited to 'files/es/web/javascript/reference/functions/arguments/length') diff --git a/files/es/web/javascript/reference/functions/arguments/length/index.html b/files/es/web/javascript/reference/functions/arguments/length/index.html new file mode 100644 index 0000000000..b1d7698194 --- /dev/null +++ b/files/es/web/javascript/reference/functions/arguments/length/index.html @@ -0,0 +1,131 @@ +--- +title: arguments.length +slug: Web/JavaScript/Referencia/Funciones/arguments/length +tags: + - Funciones + - JavaScript + - Propiedades + - argumentos +translation_of: Web/JavaScript/Reference/Functions/arguments/length +--- +
{{jsSidebar("Functions")}}
+ +

La propiedad arguments.length contiene el número de argumentos pasados a una función.

+ +

Sintaxis

+ +
arguments.length
+ +

Descripción

+ +

La propiedad arguments.length devuelve el número total de argumentos pasados a una función. Esto puede ser más o menos que el número de parametros definidos. (Véase {{jsxref("Function.length")}}).

+ +

Ejemplos

+ +

Usando arguments.length

+ +

En este ejemplo definimos una función que puede sumar dos o más números.

+ +
function adder(base /*, n2, ... */) {
+  base = Number(base);
+  for (var i = 1; i < arguments.length; i++) {
+    base += Number(arguments[i]);
+  }
+  return base;
+}
+
+ +
+

Tenga en cuenta la diferencia entre {{jsxref("Function.length")}} y arguments.length

+
+ +

Especificaciones

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EspecificaciónEstadoComentario
{{SpecName('ES1')}}{{Spec2('ES1')}}Definición inicial. Implementado en JavaScript 1.1
{{SpecName('ES5.1', '#sec-10.6', 'Arguments Object')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}{{Spec2('ESDraft')}} 
+ +

Compatibilidad con los navegadores

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Véase también

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