The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Avoid common mistakes when working with reduce

Avoid common mistakes when working with reduce

4:17
In this lesson, we will be looking at two common mistakes programmers make when working with `reduce.` We will see why we always need to pass in an initial value for our accumulator as well as return the accumulator.
Watch this lesson now
Avatar
egghead.io

A programmer left her accumulator's initial value undefined - you won't believe what happened next!

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?