Logo

Programming-Idioms

History of Idiom 11 > diff from v71 to v72

Edit summary for version 72 by programming-idioms:
[Ruby] +DocURL

Version 71

2018-08-03, 20:33:59

Version 72

2018-11-21, 12:56:45

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
x.sample
Code
x.sample
Doc URL
https://docs.ruby-lang.org/en/2.5.0/Array.html#method-i-sample