Course of Raku / Functional, concurrent, reactive, and web programming / Functional programming / Reduction / Exercises
Sum a list
Problem
Using the reduce metaoperator, print the sum of the list
10, 20, 30, 40.
Example
The program prints:
100Course of Raku / Functional, concurrent, reactive, and web programming / Functional programming / Reduction / Exercises
Using the reduce metaoperator, print the sum of the list
10, 20, 30, 40.
The program prints:
100