<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/UniqueArray/init(repeating:count:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s11UniqueArrayV9repeating5countAByxGx_Sitcfc"
  },
  "title" : "init(repeating:count:)"
}
-->

# init(repeating:count:)

Creates a new array containing the specified number of a single,
repeated value.

```
init(repeating repeatedValue: Element, count: Int)
```

## Parameters

`repeatedValue`

The element to repeat.

`count`

The number of times to repeat the value passed in the
`repeating` parameter. `count` must be zero or greater.

## Discussion> Complexity: O(`count`)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)