DEV Community

Discussion on: Understanding the Fold Operation

Collapse
 
jvanbruegge profile image
Jan van Brügge

It depends on your view on it. If you name the parameter, your view is "I will fold update over the list". Without the parameter your view is "runChallenge is a fold with update and some initial value". In my opinion this focuses on the algorithm and not the data making in easier to understand. A greater percentage of the code is thr actual algorithm as opposed to unnecessary stuff