The point is how they've decided to implement Array#reduce.
If you go up to exercise 16, you'll see they force the result of reducing to always be returned inside an array.
return [accumulatedValue];
They even remind you in the comment in exercises 17 and 18:
// Remember that reduce always
// returns an array with one item.
I can't say I agree with this decision (it's not the common way to do reduce), but following their own version of reduce, then exercise 19 is correct.
isn't #19 wrong? They expect an output of [] but start the reduce with {}. ... And their answer only has one key:value, but they expect 4.The point is how they've decided to implement Array#reduce. If you go up to exercise 16, you'll see they force the result of reducing to always be returned inside an array. return [accumulatedValue]; They even remind you in the comment in exercises 17 and 18: // Remember that reduce always // returns an array with one item. I can't say I agree with this decision (it's not the common way to do reduce), but following their own version of reduce, then exercise 19 is correct.