Array
struct Array<Element> : RandomAccessCollection, MutableCollection
-
Gets a random item from the array
Returns
a randomElement?Declaration
Swift
public func random() -> Element?Return Value
a random
Element? -
Inserts a new
Elementat the beginning of the arrayDeclaration
Swift
public mutating func prepend(_ newElement: Element)
Array Extension Reference