MDN self-hosted library · e01.org
arguments.length / notebook

arguments.length

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
function func1(a, b, c) {
  console.log(arguments.length);
}
js
function adder(base /*, num1, …, numN */) {
  base = Number(base);
  for (let i = 1; i < arguments.length; i++) {
    base += Number(arguments[i]);
  }
  return base;
}