How to use Number Type in Javascript

Number

The Number type is the reference type for numeric values. To create a Number object, use the Number constructor and pass in any number.


<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript">
            var numberObject = new Number(10); 
            document.writeln(numberObject);
    </script>
</head><!--  w ww.  j  a v  a 2 s.  co m-->
<body>
</body>
</html>

Click to view the demo





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window