For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/conversion/toString.md.

toString

Converts a value to a string.

Thin wrapper over String(value) — kept as a stable surface against future global-constructor changes.

toString(42) // '42'
toString(null) // 'null'

Usage

toString(value: unknown)

Converts a value to a string.

Thin wrapper over String(value) — kept as a stable surface against future global-constructor changes.

import { toString } from 'massaman'
// or:  import { toString } from 'massaman/conversion'

toString(42) // '42'
toString(null) // 'null'

Parameters

valueunknownrequired

the value to convert.

Returns

the input value converted using JavaScript string coercion.

string