Arguments

there is built-in "arguments" object
too many - ignored
too few - undefined


function add() { 
   var tempValue = 0;
   for (I = 0; I < arguments.length; i++)
   {
      tempValue += arguments[i];
   }
   return tempValue;
}
var myTotal = add(1,2,3,4,5,6);



© 2018 Better Solutions Limited. All Rights Reserved. © 2018 Better Solutions Limited TopPrevNext