Elixir Anonymous Function

[Solved] Elixir Anonymous Function | Elixir - Code Explorer | yomemimo.com
Question : elixir anonymous function

Answered by : nguyen-quang-huy

iex> sum = fn (a, b) -> a + b end
iex> sum.(2, 3) # 5
# The & Shorthand
iex> sum = &(&1 + &2)
iex> sum.(2, 3) # 5

Source : | Last Update : Tue, 07 Jun 22

Answers related to elixir anonymous function

Code Explorer Popular Question For Elixir