Nothing here yet.
Nothing here yet.
I'm glad you liked the article, In the case where an initial value is not specified the reducer starts from index 1 and the first member of the array (index 0) is taken as the accumulator for the first execution. arr = [ 10 , 20 , 30 , 40 , 50 ] callback = function (acc, cur) { return acc + cur } arr.reduce(callback) /* first instance: 10 is taken as the initial val since one isn't specified and used as the accumulator So the callback returns */ return 10 + 20 /* Then 30 becomes the accumulator for the next execution. And it goes on */ I hope I was able to shed more light and not confuse you. Feel free to reach me.