Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript function arguments

function add() {
  var sum = 0;
  for (var i = 0, j = arguments.length; i < j; i++) {
    sum += arguments[i];
  }
  return sum;
}

add(2, 3, 4, 5); // 14
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #function #arguments
ADD COMMENT
Topic
Name
3+9 =