-
There are no arrays in Elixir.
-
You can probably use
Enum.zip_with/2. The following should do if I understand you correctly (a2takes precedennce unless it isnil):Enum.zip_with([a1, a2], fn [a, nil] -> a; [_, b] -> b end)
There are no arrays in Elixir.
You can probably use Enum.zip_with/2. The following should do if I understand you correctly (a2 takes precedennce unless it is nil):
Enum.zip_with([a1, a2], fn [a, nil] -> a; [_, b] -> b end)