August 1999
Intermediate to advanced
1488 pages
72h 53m
English
number.valueOf()
The valueOf method of the Number object is used to get the primitive value of a Number object as a number data type.
Listing 6.190 shows an example for the valueOf method. A Number object is created and set to myNum. The document then outputs the result of performing a valueOf function on the number.
<html>
<body>
<script language="JavaScript1.1">
<!–– Hide
// create a new number object
myNum = new Number(24)
// output the valueOf result.
document.write("The value of myNum is: " + myNum.valueOf());
// End Hide ––>
</script>
</body>
</html>
|
Read now
Unlock full access