title: return sum all numbers in a range
body: <pre><code>function sumAll(arr) {
      var list = [];
  
      for (var i = arr[0]; i &lt;= arr[1]; i++) {
          list.push(i);
      }
  
      var total = list.reduce(function(a, b) {
          return a + b;
  
      });
  
      return total;
  }
  
  sumAll([10, 5]);
  //sumAll([1, 4]);  //returns 10
  //sumAll([5, 10]); //returns 45
  //sumAll([4, 1]);
  </code></pre>
  
  <p>I need to sum every number in between the given arguments. For <code>sumAll([1, 4])</code> and <code>sumAll([5, 10])</code>. The code will pass because it creates all numbers in between the two arguments and adding it. However, for <code>sumAll([10, 5])</code> and <code>sumAll([4, 1])</code>, because the greater number is first argument, I believe it does not run var list. I tried using <code>.sort()</code> method in between so that the numbers are sorted but can't get it to work. How can I use <code>Math.min()</code> and <code>Math.max()</code> for this code to work?</p>