Description
The valueOf() method is used to return the primitive value of a Number object.
This method has the form:
number.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 num = new Number(15);
document.write(num.valueOf());
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|