---
title: "subscript(_:as:default:)"
framework: xpc
role: symbol
role_heading: Instance Subscript
path: "xpc/xpcarray/subscript(_:as:default:)-3h2ng"
---

# subscript(_:as:default:)

Get a value in this array as a file descriptor.

## Declaration

```swift
subscript(index: Int, as type: FileDescriptor.Type = FileDescriptor.self, default defaultValue: @autoclosure () -> FileDescriptor) -> FileDescriptor { get }
```

## Parameters

- `index`: The index at which to get the file descriptor.
- `type`: The expected type of the resulting value.
- `defaultValue`: The value to produce if no file descriptor is available at index.

## Return Value

Return Value A file descriptor value, possibly defaultValue.

## Overview

Overview The returned file descriptor is owned by the caller so they must close it.
