User:Ushkin N/Comparison of programming languages/Functional/Fold

See Fold (higher-order function).