JavaScript | string.toString()
The string.toString() is an inbuilt function in JavaScript which is used to return the given string itself.
Syntax:
string.toString()
Parameters: It does not accept any parameter.
Return Values: It returns a new string represent the given string object.
JavaScript code to show the working of string.toString() function:
<script> // Taking a string as input and printing it // with the help of string.toString() function var a = new String("GeeksforGeeks"); document.write(a.toString()); </script> |
chevron_right
filter_none
Output:
GeeksforGeeks
Recommended Posts:
- this in JavaScript
- Map.has( ) In JavaScript
- Map in JavaScript
- Map.get( ) In JavaScript
- Atomics.xor( ) In JavaScript
- Atomics.and( ) In JavaScript
- Atomics.or( ) In JavaScript
- JavaScript | Callbacks
- JavaScript | weakMap.get()
- JavaScript | Operators
- Atomics.add( ) In JavaScript
- Functions in JavaScript
- Object.is( ) in JavaScript
- JavaScript | Focus()
- JavaScript | Boolean
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Pallavi Yadav



