June 2022
Intermediate to advanced
130 pages
2h 45m
English
Elixir has two Boolean values, and you’ve already seen they’re expressed as atoms. Here’s a quick overview of Booleans in Elixir:
This tiny error provides some quick proof of these concepts in IEx:
| | iex(1)> nil && true |
| | nil |
| | iex(2)> nil and true |
| | ** (BadBooleanError) expected a boolean on left-side of "and", got: nil |
| | |
| | iex(2)> nil || true |
| | true |
| | iex(3)> !nil |
| | true |
| | iex(4)> not nil |
| | ** (ArgumentError) argument error |
| | :erlang.not(nil) |
In Elixir’s truthy expressions, ...
Read now
Unlock full access