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> |
Output:
GeeksforGeeks
leave a comment
0 Comments