Course of Raku / Advanced / Subroutines / The Whatever star 🆕 / Exercises

Whatever with map

Problem

A WhateverCode is an ordinary function value, so you can store it and hand it to map. Build a one-argument function that triples its argument, store it in $triple, and use it to map the list 1..4. Print the result.

Example

The program prints:

(3 6 9 12)

Solution

See the solution

Course navigation

The Whatever star 🆕   |   Solution: Whatever with map