The Fauna service will be ending on May 30, 2025.

For more information on the service wind down, see our announcement and the Fauna Service End-of-Life FAQ.

string.toString()

Get a String representation of the value.

Signature

toString() => String

Description

Returns a String representation of the calling value. If the calling value is a String, it returns the calling String. The calling value isn’t changed.

Parameters

None

Return value

Type Description

String

String representation of the calling String.

Examples

Pass a String

Confirm that the calling string type returns itself:

'foobar'.toString()
"foobar"

Pass a Time value

Get the String representation of a Time() value:

let t1 = Time.fromString("2099-10-20T21:15:09.890729Z")
t1.toString()
"2099-10-20T21:15:09.890729Z"

Pass a Number

Get the String representation of a floating point number:

1.5.toString()
"1.5"

Pass a Null value

If passed Null, toString() returns a "null" string representation. For example:

{a: null}.a?.toString()
"null"
\