Version: v0.6.0 - Beta.  We welcome contributors & feedback.  THanks!

List.map

map($callbackFunction)

Description

Apply the callback function to every element in the List.

Returns a list of all values returned by the callback.

(This example uses Expression Function notation x{ ... }.)

$fnSquare = x{ $a ** 2 };

[1, 2, 3, 4].map($fnSquare);
//= [2, 4, 8, 16]

See Also