# selection.Selection.toArray

- **Module:** selection.Selection
- **Package:** @libtmux/libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/2cb93308200da38a26b59876618116850f110607/packages/libtmux/src/selection.ts#L377
- **Page:** https://libtmux.org/reference/ts/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);
```
