# selection.Selection.exists

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

```
selection.Selection.exists(criteria: : WhereOf<Model>) -> boolean
```

Whether anything matches. Cheaper to read than comparing a count to zero.

## Example

```ts
if (snapshot.windows.exists({ name: "build" })) {
  await session.selectWindow("build");
}
```
