Contents

append(_:)

Adds an element to the end of the array.

Declaration

mutating func append(_ item: consuming Element)

Parameters

  • item:

    The element to append to the collection.

Discussion

If the array does not have sufficient capacity to hold any more elements, then this reallocates the array’s storage to grow its capacity, using a geometric growth rate.