Easy Tutorial
❮ Prop Screen Width Prop Track Src ❯

JavaScript String() Function


Definition and Usage

The String() function converts the value of an object to a string.

Syntax

Parameter Description
object Required. A JavaScript object.

Browser Support

All major browsers support the String() function.


Tips and Notes

Note: The String() function returns the same value as the toString() method of the string object.


Examples

Convert different objects to strings:

The output of the above examples:

❮ Prop Screen Width Prop Track Src ❯