Underscore reduce, about memo

Viewed 5128

According the documentation underscore-reduce I should pass three parameters.

For example:

var m = _.reduce([1,2,3], function (memo, num) {return (num * 2) +memo }, 0);
m; // 12 as expected

If I try to pass just the first two parameters I get a different value. Why?

var m = _.reduce([1,2,3], function (memo, num) {return (num * 2) +memo });
m; // 11 ..why?
2 Answers
Related