This method returns the primitive value of the specified number object.
Its syntax is as follows −
number.valueOf()
Returns the primitive value of the specified number object.
Try the following example.
<html> <head> <title>JavaScript valueOf() Method </title> </head> <body> <script type="text/javascript"> var num = new Number(15.11234); document.write("num.valueOf() is " + num.valueOf()); </script> </body> </html>
num.valueOf() is 15.11234