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.

예제

구문

str(n)

매개변수

n

value to convert.

Notice any errors or typos? Please let us know. Please feel free to edit src/utilities/conversion.js and open a pull request!

관련 레퍼런스