DEV Community

Discussion on: Learning the reduce function part 1

Collapse
 
jonrandy profile image
Jon Randy 🎖️

initalValue can also be omitted - if it is omitted, it will automatically be set to the first value of the array and the reduce will proceed from the next item. This can be advantageous for performance

Collapse
 
quality_pre profile image
Adam Preece

Thank you for posting that useful tip!