Today I Learned

hashrocket A Hashrocket project

Random enum element in elixir

Enum.random is a simple way to select a random element of an Elixir enum.

[1, 2, 3]
|> Enum.random()
# => who knows?? either 1, 2, or 3
See More #elixir TILs
Looking for help? At Hashrocket, we 💜 Elixir! From our many Elixir client projects, to sponsoring the Chicago Elixir Meetup, to the source code for this application, we are invested in this community. Contact us today to talk about your Elixir project.