Skip to content

Commit d525648

Browse files
SunJieMingSunJieMing
authored andcommitted
Fixed solution that was altered in git conflict
1 parent cc276d0 commit d525648

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/arrays.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const map = (elements, cb) => {
2222
return mappedArr;
2323
};
2424

25-
const reduce = (elements, cb, startingValue) => {
25+
const reduce = (elements, cb, startingValue = elements.shift()) => {
2626
// Combine all elements into a single value going from left to right.
2727
// Elements will be passed one by one into `cb`.
2828
// `memo` is the starting value. If `memo` is undefined then make `elements[0]` the initial value.

0 commit comments

Comments
 (0)