Enum.map
You're seeing just the function
map
, go back to Enum module for more information.
Specs
Returns a list where each element is the result of invoking
fun
on each corresponding element of enumerable
.
For maps, the function expects a key-value tuple.
Examples
iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
[2, 4, 6]
iex> Enum.map([a: 1, b: 2], fn {k, v} -> {k, -v} end)
[a: -1, b: -2]