function | since v0.0-927 | clojure.core/rand-nth | Edit |
(rand-nth coll)
Returns a random element from a sequential collection coll
.
Has the same performance characteristics as nth
.
Return a random element of the (sequential) collection. Will have the same performance characteristics as nth for the given collection.
(defn rand-nth
[coll]
(nth coll (rand-int (count coll))))