Version: v0.7.1 - Beta.  We welcome contributors & feedback.

List.map

map($callbackFunction) -> list

Description

Apply the callback function to every item 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