/ Published in: JavaScript
Pass as many arguments as you wish. You can access them in the arguments array.
Expand |
Embed | Plain Text
function addStuff() { var total = 0; for (var ii = 0; ii < arguments.length; ii++) { //Not only does this iterate through arguments, it uses the + to force addition instead of concatenation total += +arguments[ii]; } return total; }
You need to login to post a comment.
