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
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