Functional programming means designing our program around self-contained functions that don’t rely on state or mutation.
In functional programming, everything the function needs to do its job is passed as an input argument, and the function provides its result as a return value, which replaces the previous value.
A benefit of functional programming is that it makes functions easier to test. It also promotes composability, which is the idea of combining simple, self-contained functions to produce more elaborate behavior.
for/fold is a convenient way of approximating state & mutation by updating an accumulator while iterating over a list of values.