Skip to content

Commit 0ed83ef

Browse files
SunJieMingSunJieMing
authored andcommitted
Updated reduce instructions
1 parent a895a97 commit 0ed83ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/arrays.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const map = (elements, cb) => {
1818

1919
const reduce = (elements, cb, startingValue) => {
2020
// Combine all elements into a single value going from left to right.
21-
// Elements will be passed one by one into `cb`.
21+
// Elements will be passed one by one into `cb` along with the `startingValue`.
22+
// `startingValue` should be the first argument passed to `cb` and the array element should be the second argument.
2223
// `startingValue` is the starting value. If `startingValue` is undefined then make `elements[0]` the initial value.
2324
};
2425

0 commit comments

Comments
 (0)