Creates a collection containing the specified number of the given element.
SDK
- Xcode 8.0+
Framework
- Swift Standard Library
Declaration
Parameters
element
The element to repeat.
count
The number of times to repeat
element
.
Return Value
A collection that contains count
elements that are all element
.
Discussion
The following example creates a Repeated<Int>
collection containing five zeroes: