Javascript Array Iterative Methods (Part 3.2): Your own reduce function!

preview_player
Показать описание
[ * ] About the video

You will learn how to implement the most basic form of "reduce" algorithm by iterating over the array and checking if the current index of iteration is 0, if so, the value of "previous" should be the first item and the value of "current" should always be the next item if we want to start counting from 0. It can go many ways in the for loop, we could just avoid subtracting 1 in the "len" variable but subtract 1 in the first value of prev inside the if statement.

-------------------------------------------------------------

[ * ] Possible questions by the viewers

OS: Elementary OS (Ubuntu-based Linux distribution)
Capture software: Kazam
OS Icon Theme: Numix Circle

---------------------------------------------------------------

[ * ] Relevant links:

Рекомендации по теме
visit shbcf.ru