# selection.Selection.toArray

- **Module:** selection.Selection
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/selection.ts#L383
- **Page:** https://libtmux.org/en/ts/latest/reference/selection-selection-toarray/

```
selection.Selection.toArray() -> Model[]
```

A plain array of the members, in order.

The crossing to array semantics: slicing, reversing, indexing, spreading.
The result is a copy, so mutating it cannot disturb the Selection.

## Example

```ts
const ordered = snapshot.panes.toArray();
ordered.slice(0, 2).map((entry) => entry.id);
```
