mirror of
https://github.com/wnagrodzki/ProgrammingElixir1.6-MyTurns.git
synced 2025-05-03 01:21:50 +02:00
7 lines
No EOL
215 B
Elixir
7 lines
No EOL
215 B
Elixir
# Use the & notation to rewrite the following:
|
|
#
|
|
# Enum.map [1,2,3,4], fn x -> x + 2 end
|
|
# Enum.each [1,2,3,4], fn x -> IO.inspect x end
|
|
|
|
IO.inspect Enum.map [1,2,3,4], &(&1 + 2)
|
|
Enum.each [1,2,3,4], &(IO.inspect/1) |