JavaScript | string.valueOf()
The string.valueOf() is an inbuilt function in JavaScript which is used to return the value of the given string.
Syntax:
string.valueOf()
Parameters: It does not accept any parameter.
Return Values: It returns a string which represent the value of the given string object.
<script> // Taking a string as input and printing it // with the help of string.valueOf() function var a = new String("GeeksforGeeks"); document.write(a.valueOf()); </script> |
chevron_right
filter_none
Output:
GeeksforGeeks
Recommended Posts:
- Introduction to JavaScript Course | Learn how to Build a task tracker using JavaScript
- How to compare two JavaScript array objects using jQuery/JavaScript ?
- JavaScript Course | Understanding Code Structure in JavaScript
- JavaScript Course | Conditional Operator in JavaScript
- JavaScript Course | Data Types in JavaScript
- JavaScript Course | Printing Hello World in JavaScript
- JavaScript Course | Logical Operators in JavaScript
- JavaScript Course | Operators in JavaScript
- JavaScript Course | Functions in JavaScript
- JavaScript Course | Objects in JavaScript
- JavaScript Course | Loops in JavaScript
- JavaScript Course | Variables in JavaScript
- JavaScript Course | JavaScript Prompt Example
- JavaScript vs Python : Can Python Overtop JavaScript by 2020?
- How to include a JavaScript file in another JavaScript file ?
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.


