map
Returns a list containing transform applied once to each element in iteration order.
Creates a new list and retains all transformed values, including nulls. The result has the same iteration order as the source. Exceptions from iteration or the callback propagate to the caller. The inline callback supports non-local returns.
Receiver
elements to visit in their iteration order.
Return
a new read-only list of results; empty when the source is empty.
Parameters
transformation receiving the current element.
See also
Returns a list containing transform applied once to each element in iteration order.
Creates a new list and retains all transformed values, including nulls. Reserves the collection size as the initial result capacity. The result has the same iteration order as the source. Exceptions from iteration or the callback propagate to the caller. The inline callback supports non-local returns.
Receiver
elements to visit in their iteration order.
Return
a new read-only list of results; empty when the source is empty.
Parameters
transformation receiving the current element.