![]() |
VOOZH | about |
The symbol.toString() is an inbuilt method in JavaScript that is used to convert the specified symbol object into the string.
Syntax:
Symbol().toString();
Here Symbol() is the specified symbol object which is to be converted into a string.
Parameters: This method does not accept any parameter.
Return value: This method returns the converted string of the specified symbol object. JavaScript code to show the working of this method:
Example-1:
Output:
Symbol(gfg) Symbol(42) Symbol()
Example-2:
Output:
Symbol(Geeks) Symbol(Symbol.iterator) Symbol(Geeks)
Supported Browsers:
Reference: https://devdocs.io/javascript/global_objects/symbol/tostring