List.map
map($callbackFunction) -> list
Description
NoteThis is a functional
map method. To convert a List to a Map, see toMap.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]