JavaScript String valueOf() Method
Clash Royale CLAN TAG#URR8PPP
<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]-->
JavaScript String valueOf() Method
❮
Reference
<!--
❮ JavaScript String Reference
-->Example
Return the primitive value of a string object:
var str = "Hello World!";
var res = str.valueOf();
<!--
The result res of will be:
Hello World!
-->Try it Yourself »
Definition and Usage
The valueOf() method returns the primitive value of a String object.
Note: This method is usually called automatically by JavaScript behind the scenes, and not explicitly in code.
Browser Support
Method | |||||
---|---|---|---|---|---|
valueOf() | Yes | Yes | Yes | Yes | Yes |
Syntax
string.valueOf()
Parameters
None |
Technical Details
Return Value: | A String, representing the primitive value of a string |
---|---|
JavaScript Version: | ECMAScript 1 |
❮
Reference
<!--
❮ JavaScript String Reference
-->