Skip to main content
You are viewing Pre-Alpha documentation.
Vuetify0 Logo
Mode
Accessibility
Vuetify

toArray

The toArray utility function provides a consistent way to convert any value into an array format. It handles edge cases like null and undefined values, and ensures that the output is always an array.

Intermediate100% coverageJan 11, 2026

Usage

ts
import { toArray } from '@vuetify/v0'

const value = 'Example Value'
const valueAsArray = toArray(value)

console.log(valueAsArray) // ['Example Value']

Architecture

toArray is a pure transformation utility:

Array Transformation

Use controls to zoom and pan. Click outside or press Escape to close.

Array Transformation

API Reference

The following API details are for the toArray composable.

Functions

toArray

(value: Z | Z[]) => Z[]

Converts a value to an array.

Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/