Try the revamped Kotlin docs design →
Try the revamped Kotlin docs design!
random
fun <T> Array<out T>.random(): T
(source)
Returns a random element from this array.
Exceptions
NoSuchElementException
- if this array is empty.
Returns a random element from this array using the specified source of randomness.
Exceptions
NoSuchElementException
- if this array is empty.
Returns a random element from this collection.
Exceptions
NoSuchElementException
- if this collection is empty.
Returns a random element from this collection using the specified source of randomness.
Exceptions
NoSuchElementException
- if this collection is empty.