# selection.Selection.first

- **Module:** selection.Selection
- **Package:** @libtmux/libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/2cb93308200da38a26b59876618116850f110607/packages/libtmux/src/selection.ts#L448
- **Page:** https://libtmux.org/reference/ts/selection-selection-first/

```
selection.Selection.first(criteria: : WhereOf<Model>) -> Model | undefined
```

The first member, or the first matching `criteria`.

Answers undefined for no match. Use this when zero is an ordinary outcome;
use `one` when it is not.

## Example

```ts
snapshot.windows.first({ name: "editor" })?.id;
```
