---
title: "flatMap(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/emptycollection/flatmap(_:)-5fdv6"
---

# flatMap(_:)

## Declaration

```swift
func flatMap<ElementOfResult>(_ transform: (Self.Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult]
```
