Using Comprehensions

Learn to use Elixir's comprehensions.

We'll cover the following...

for

Elixir has the for special form that offers a shortcut syntax over the most basic operations of enumerables, it is also known as a comprehension. We can iterate, map, and filter easily. Take a look:

iex> for a <- ["dogs", "cats", "flowers"], do: String.upcase(a) 
#Output
...