---
title: reverse()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/arrayslice/reverse()
---

# reverse()

Reverses the elements of the collection in place.

## Declaration

```swift
mutating func reverse()
```

## Discussion

Discussion The following example reverses the elements of an array of characters: var characters: [Character] = ["C", "a", "f", "é"] characters.reverse() print(characters) // Prints "["é", "f", "a", "C"]" note: O(n), where n is the number of elements in the collection.
