repeatElement

func repeatElement(_:count:)(_ element: T, count n: Int) -> Repeated<T>

Creates a collection containing the specified number of the given element.

The following example creates a Repeated<Int> collection containing five zeroes:

let zeroes = repeatElement(0, count: 5)
for x in zeroes {
    print(x)
}
// 0
// 0
// 0
// 0
// 0