Get last nth elements from Enumerable in #Elixir
You probably know about `Enum.take(n)` where `n` is a number dictating how many elements you want to take from an Enumerable. Use it like this:
```elixir
[1, 2, 3, 4, 5]
|> Enum.take(3)
# => [1, 2, 3]
```
But how can you get the last 3 elements? Just use a negative number!
```elixir
[1, 2, 3, 4, 5]
|> Enum.take(-3)
# => [3, 4, 5]
```
doriankarter
June 22, 2018