Hey everyone, can anyone explain the difference between fold(n) and reduce(). I have heard it described as “fold lets you provide an initial value” but it seems like there’s more to it than that. Like
l.fold(""){acc, it -> acc + ", " + it}
, Foo, Bar, Boz
l.reduce{acc, it -> acc + ", " + it}
Foo, Bar, Boz