I am new to Elixir but I couldn't find an answer to my question.
Here are some examples I have entered to iex
.
expression result
9 || true 9
true || 9 true
9 && true true
true && 9 9
So, when there is an ||
it will evaluate to first argument, and &&
to last when one argument is not boolean.
How are ||
and &&
implemented? Why are they returning those results?