title: Return sum of all arguments passed to function
body: <p>One way is to use arguments. I can loop over the arguments array and can return the sum of all the arguments passed.</p>
  
  <pre><code>function sum(){
    var sum =0; 
    for(var i=0;i&lt;arguments.length;i++){
       sum += arguments[i];
    }
     return sum;
  }
  sum(1,2); // returns 3
  sum(1,2,3); // returns 6
  </code></pre>
  
  <p>Is there any other way to do it without using loop?</p>