Skip to content

Commit cda4ca3

Browse files
Update reduce method callback - Q10
Update reduce method callback to return the maximum value number.
1 parent 9677148 commit cda4ca3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

challenges/collections-challenges.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ position; // position of max number
243243
```
244244

245245
```js
246-
const max = arr.reduce((a, b) => a < b ? a : b);
246+
const max = arr.reduce((a, b) => a > b ? a : b);
247247
arr.indexOf(max); // position of max number
248248
```
249249

0 commit comments

Comments
 (0)