[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [toArray](./js-utils.toarray_1.md)
## toArray() function
Copy an existing readonly array-like or convert a single value to a readonly array.
Signature:
```typescript
export declare function toArray(val: Maybe>): ReadonlyArray;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| val | [Maybe](./js-utils.maybe.md)<TVal \| ReadonlyArray<TVal>> | |
Returns:
ReadonlyArray<TVal>