---
title: clone()
framework: Swift
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+, watchOS 27.0+]
path: swift/uniquearray/clone()
---

# clone()

Copy the contents of this array into a newly allocated unique array instance with just enough capacity to hold all its elements.

## Declaration

```swift
func clone() -> UniqueArray<Element>
```

## Discussion

Discussion note: O(count)
