Sum All Numbers in a Range: I can not pass by this code!

Tell us what’s happening:

Your code so far

function sumAll(arr) {
  var sum = [];
  for (i = Math.min(...arr); i <= Math.max(...arr); i++) {
    sum.push(i);
  }
  
  return sum.redeuc(function(a,b){ return a+b; },0);
}

sumAll([1,4]);

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.104 Safari/537.36.

Link to the challenge:

let me make it clear ,here is my code :

function sumAll(arr) {
var sum = ;
for (i = Math.min(…arr); i <= Math.max(…arr); i++) {
sum.push(i);
}

return sum.redeuc(function(a,b){ return a+b; },0);
}

console.log(sumAll([1,4]));

I got a error when I run it in Chrome DevTools (browser side):

Uncaught TypeError : sum.reduce is not a function

It is not error return when I run it in a terminal use node command(Node-server side) ; I am curious about why this happen?

I can pass any Array to arr and get correct answer back, I am using fish shell in Ubuntu 16.04 LTS, Node version 6.9.1

Yes, you are right !!! Thank you.