Array

struct Array<Element> : RandomAccessCollection, MutableCollection
  • Gets a random item from the array

    Returns

    a random Element?

    Declaration

    Swift

    public func random() -> Element?

    Return Value

    a random Element?

  • Inserts a new Element at the beginning of the array

    Declaration

    Swift

    public mutating func prepend(_ newElement: Element)