Number.valueOf() : valueOf « Number Data Type « JavaScript Tutorial






The valueOf method gets the primitive value of a Number object as a number data type.

<html>
    <body>
    <script language="JavaScript1.1">
    <!--
    myNum = new Number(24)

    document.write("The value of myNum is: " + myNum.valueOf());
    -->
    </script>
    </body>
    </html>








5.10.valueOf
5.10.1.Number.valueOf()
5.10.2.Demonstrating the valueOf() method