# selection.Selection.exists

- **Module:** selection.Selection
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/selection.ts#L493
- **Page:** https://libtmux.org/en/ts/latest/reference/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");
}
```
