defmodule Solution do def sum(a, b) do # https://elixir-lang.org/getting-started/modules-and-functions.html#function-capturing add = &+/2 add.(a, b) end end
- defmodule Solution do
def sum(a, b), do: a + b- def sum(a, b) do # https://elixir-lang.org/getting-started/modules-and-functions.html#function-capturing
- add = &+/2
- add.(a, b)
- end
- end