Fold
Fold[f, x, {a, b}]
returns f[f[x, a], b]
, and this nesting continues for lists of arbitrary length. Fold[f, {a, b, c}]
returns Fold[f, a, {b, c}]
. Fold[f]
is an operator form that can be applied to expressions such as {a, b, c}
.
Attributes[Fold] := {Protected}