---
title: removeFirst()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/collection/removefirst()
---

# removeFirst()

Removes and returns the first element of the collection.

## Declaration

```swift
@discardableResult mutating func removeFirst() -> Self.Element
```

## Return Value

Return Value The first element of the collection.

## Discussion

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

## See Also

### Selecting and Excluding Elements

- [popFirst()](swift/collection/popfirst().md)
- [removeFirst(_:)](swift/collection/removefirst(_:).md)
