Description
The valueOf() method is used to return the primitive value of a String object.
This method has the form:
String.valueOf()
Note: This method is usually called automatically by JavaScript, and not explicitly in code.
Examples
The following example shows the basic use of this method.
<script>
var s = "Hello from JavaScript";
document.write(s.valueOf());
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|