A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Functions/arguments/length below:

arguments.length - JavaScript | MDN

arguments.length

Baseline Widely available

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

Sintaxis 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 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;
}

Nota: Tenga en cuenta la diferencia entre Function.length y arguments.length

Especificaciones Compatibilidad con navegadores Véase también

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4