CollectionExtensions<T> extension

on

Methods

random() → T?
Returns a random element from the collection. If there are no items, returns null. If there's only one item, returns that item.