Return the primitive value of a string object:
The result res of will be:
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.
Method | |||||
---|---|---|---|---|---|
valueOf() | Yes | Yes | Yes | Yes | Yes |
None |
Return Value: | A String, representing the primitive value of a string |
---|---|
JavaScript Version: | 1.1 |