JavaScript String valueOf() MethodThe JavaScript string valueOf() method is used to find out the primitive value of String object. This method is invoked by JavaScript automatically. Thus, there is no requirement to call it explicitly in the code. SyntaxThe valueOf() method is represented by the following syntax: ReturnsA string representing the primitive value of string object. JavaScript String valueOf() Method ExampleLet's see some simple examples of valueOf() method. Example 1Here, we will print the primitive value of string object. Test it NowOutput: Javatpoint Example 2Let's see one more example to print the primitive value of string object. Test it NowOutput: Javatpoint Next TopicJavaScript String |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India