Reference str()

str()

Converts a Boolean or Number to String.

str() converts values to strings. See the String reference page for guidance on using template literals instead.

The parameter, n, is the value to convert. If n is a Boolean, as in str(false) or str(true), then the value will be returned as a string, as in 'false' or 'true'. If n is a number, as in str(123), then its value will be returned as a string, as in '123'. If an array is passed, as in str([12.34, 56.78]), then an array of strings will be returned.

Examples

Syntax

str(n)

Parameters

n
String|Boolean|Number:

value to convert.

Returns

String: converted string.
This page is generated from the comments in src/utilities/conversion.js . Please feel free to edit it and submit a pull request!

Related References