3 ms·
In reduce the accumulator starts as the seed and is changed in the forEach for each elem. Since there are so elems (funs) the accumulator never changes and retu
by fogus 13y ago
In reduce the accumulator starts as the seed and is changed in the forEach for each elem. Since there are so elems (funs) the accumulator never changes and returns as the value of seed (5).
- tomTheBom 13y agoOf course. Shoulda seen that. ;) forEach on an empty collection returns immediately. Thanks.