---
title: removeLast()
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/removelast()
---

# removeLast()

Removes and returns the last element of the array.

## Declaration

```swift
@discardableResult mutating func removeLast() -> Element
```

## Return Value

Return Value The last element of the original array.

## Discussion

Discussion The array must not be empty. note: O(1)
