Logo

Programming-Idioms

History of Idiom 11 > diff from v87 to v88

Edit summary for version 88 by hover:
[Kotlin] add doc

Version 87

2020-02-09, 17:54:57

Version 88

2020-04-29, 09:36: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
list.random()
Code
list.random()
Doc URL
https://kotlinlang.org/docs/reference/collection-elements.html#random-element