I'm a Frontend developer located in Madrid. With a background in tech support, I decide 3 years ago to turn my world upside down and downsize my sleeping hours by learning to code.
Great post! Very clear and well detailed, one thing I noticed is that in the first example the reduce function is not targeting arrayOfPeople but arr.... And the curr value is referring to each object of the array so in order to work it has to be acc + curr.age. I know it was an example to illustrate the concept, but for the reader that never has worked with this it might be confusing...
Thanks for the effort to help this community grow, and keep up the good work!
Great post! Very clear and well detailed, one thing I noticed is that in the first example the reduce function is not targeting arrayOfPeople but arr.... And the curr value is referring to each object of the array so in order to work it has to be acc + curr.age. I know it was an example to illustrate the concept, but for the reader that never has worked with this it might be confusing...
Thanks for the effort to help this community grow, and keep up the good work!
Thanks so much for catching that! I updated it in the article. I'm glad you enjoyed the post, and thanks for the support!