We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db3e238 commit 6f34587Copy full SHA for 6f34587
src/arrays.js
@@ -16,10 +16,10 @@ const map = (elements, cb) => {
16
// Return the new array.
17
};
18
19
-const reduce = (elements, cb, memo = elements.shift()) => {
+const reduce = (elements, cb, startingValue) => {
20
// Combine all elements into a single value going from left to right.
21
// Elements will be passed one by one into `cb`.
22
- // `memo` is the starting value. If `memo` is undefined then make `elements[0]` the initial value.
+ // `startingValue` is the starting value. If `startingValue` is undefined then make `elements[0]` the initial value.
23
24
25
const find = (elements, cb) => {
0 commit comments