Logo

Programming-Idioms

History of Idiom 11 > diff from v82 to v83

Edit summary for version 83 by programming-idioms.org:
[Elixir] Dead link: play.elixirbyexample.com has been down for a while

Version 82

2019-10-01, 16:19:23

Version 83

2019-10-14, 12:21:40

Idiom #11 Pick a random element from a list

List x must be non-empty.

Illustration

Idiom #11 Pick a random element from a list

List x must be non-empty.

Illustration
Extra Keywords
choose
Extra Keywords
choose
Code
Enum.random(x)
Code
Enum.random(x)
Doc URL
http://elixir-lang.org/docs/stable/elixir/Enum.html#random/1
Doc URL
http://elixir-lang.org/docs/stable/elixir/Enum.html#random/1
Demo URL
http://play.elixirbyexample.com/s/f9f0161650