Return a random element of the (sequential) collection. Will have
the same performance characteristics as nth for the given
collection.
(defn rand-nth
"Return a random element of the (sequential) collection. Will have
the same performance characteristics as nth for the given
collection."
{:added "1.2"
:static true}
[coll]
(nth coll (rand-int (count coll))))
Comments top
No comments for rand-nth. Log in to add a comment.