Version: v0.5.1 - 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 the F and R shortcuts for function and return.)

let fnSquare = F (a) { R a ** 2 };

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

See Also