JavaScript String Object
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.
![]()
The valueOf() method is supported in all major browsers.
Return the primitive value of a string object:
The output of the code above will be:
JavaScript String Object
Your message has been sent to W3Schools.