> For the complete documentation index, see [llms.txt](https://martins-victor.gitbook.io/1loc-lib/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://martins-victor.gitbook.io/1loc-lib/one-liners/castasarray.md).

# castAsArray

Casts any value to an array.

This function accepts any value and returns an array of that value.

```javascript
import { castAsArray } from '1loc'

const stringValue = 'me'
const arrValue = [2, 3, 4]

castAsArray(value) // ['me']
castAsArray(arrValue) // [2, 3, 4]
```
