• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

The Number Object

As you can guess from its name, the Number object handles numbers. Mostly, there’s little need to use this object, because you can just use simple numbers instead, and JavaScript is good at that. In fact, JavaScript creates Number objects from simple numbers automatically as it needs them. It’s useful to know the properties and methods of the Number object, however, and you can find them in Table 19.4 in overview, its properties in depth in Table 19.5, and its methods in depth in Table 19.6.

Table 19.4. Overview of the Properties and Methods of the Number Object
Properties Methods
constructor toExponential
MAX_VALUE toFixed
MIN_VALUE toLocaleString
NaN toPrecision
NEGATIVE_INFINITY toString
POSITIVE_INFINITY valueOf
Prototype 



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint