DEV Community

loading...

Discussion on: Higher-order functions in Javascript

Collapse
damcosset profile image
Damien Cosset Author

The reduce function takes an optional second parameter that indicates the initial value. If I wanted to start counting from 10,that second parameter would have been 10. Here, I wanted to start counting from 0.