---
title: "output(at:)"
framework: combine
role: symbol
role_heading: Instance Method
path: "combine/publisher/output(at:)"
---

# output(at:)

Publishes a specific element, indicated by its index in the sequence of published elements.

## Declaration

```swift
func output(at index: Int) -> Publishers.Output<Self>
```

## Parameters

- `index`: The index that indicates the element to publish.

## Return Value

Return Value A publisher that publishes a specific indexed element.

## Discussion

Discussion Use output(at:) when you need to republish a specific element specified by its position in the stream. If the publisher completes normally or with an error before publishing the specified element, then the publisher doesn’t produce any elements. In the example below, the array publisher emits the fifth element in the sequence of published elements: let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] numbers.publisher     .output(at: 5)     .sink { print("\($0)") }

// Prints: "6"

## See Also

### Selecting specific elements

- [first()](combine/publisher/first().md)
- [first(where:)](combine/publisher/first(where:).md)
- [tryFirst(where:)](combine/publisher/tryfirst(where:).md)
- [last()](combine/publisher/last().md)
- [last(where:)](combine/publisher/last(where:).md)
- [tryLast(where:)](combine/publisher/trylast(where:).md)
- [output(in:)](combine/publisher/output(in:).md)
