From Ruby to Elixir:

@sb8244

From Ruby to Elixir -
iex(1)> Enum.reduce([1, 2, 3], 0, fn num, ac → if num > max, do: num, else: ac end)
error: undefined variable “max”
└─ iex:6
** (CompileError) cannot compile code (errors have been logged)
command not working (page 42)

1 Like