Possible Duplicate:
Is it possible to send a variable number of arguments to a JavaScript function?
How would I pass a different number of variables to a function every time I call it?
For example if I have function add(), would I be able to pass 5 arguments to it and use arguments.length in loop to do the sum?