Elixir Enum Map

[Solved] Elixir Enum Map | Elixir - Code Explorer | yomemimo.com
Question : elixir enum map

Answered by : nguyen-quang-huy

iex> Enum.map(1..3, fn x -> x * 2 end)
[2, 4, 6]
iex> map = %{"a" => 1, "b" => 2}
iex> Enum.map(map, fn {k, v} -> {k, v * 2} end)
[{"a", 2}, {"b", 4}]

Source : https://hexdocs.pm/elixir/Enum.html | Last Update : Wed, 29 Dec 21

Question : elixir enum map

Answered by : juan-d-khusuma

Enum.map([0, 1, 2, 3], fn(x) -> x - 1 end)
[-1, 0, 1, 2]

Source : https://elixirschool.com/en/lessons/basics/enum | Last Update : Fri, 20 May 22

Answers related to elixir enum map

Code Explorer Popular Question For Elixir