# map
Transform each element of a list using a function.
## Syntax
[map $list { body }] [map $list { |name| body }]
## Examples
[map @{ 1 2 3 } { ($it * 2) }] # @{ 2 4 6 } [map @{ "a" "b" } { [upper $it] }] # @{ "A" "B" }
# Pipeline style @{ 1 2 3 4 5 } |> [map { ($it * 10) }] |> [collect] # @{ 10 20 30 40 50 }
## Parameters
| Parameter | Description |
|-----------|-------------|
| `list` | Collection to transform |
| `{ body }` | Lambda block; `$it` is the current element |
## Returns
New list with transformed elements. Returns a lazy sequence — use `[collect]` before `[join]`.
## See Also
`filter`, `reduce`, `each`, `flat-map`, `collect`