25 lines
665 B
Markdown
25 lines
665 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[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.
|
|
|
|
<b>Signature:</b>
|
|
|
|
```typescript
|
|
export declare function toArray<TVal>(val: Maybe<TVal | ReadonlyArray<TVal>>): ReadonlyArray<TVal>;
|
|
```
|
|
|
|
## Parameters
|
|
|
|
| Parameter | Type | Description |
|
|
| --- | --- | --- |
|
|
| val | [Maybe](./js-utils.maybe.md)<!-- --><TVal \| ReadonlyArray<TVal>> | |
|
|
|
|
<b>Returns:</b>
|
|
|
|
ReadonlyArray<TVal>
|
|
|