Basic JavaScript #29: Array.reduce

preview_player
Показать описание
Let us learn about reduce method available for arrays which allows us to iterate over arrays in JavaScript.
Рекомендации по теме
Комментарии
Автор

Hi, You said that accumulator contains whatever we have done with values so far, so why didn't accumulator starts with 0 and current value with 1 ? And secondly, you said we can pass any value to the accumulator as a second argument, so if we pass 3 as a second argument, so it means the 3rd index of the array or the value/number 3?

ishumitamohan