HTML and CSS Reference
The type number represents floating point numbers with zero or more decimal places. There are
no separate types for concepts such as integers, long integers, singles, doubles, or bytes. One special
number, NaN , is reserved for numbers that don't make mathematical sense—it is a variable that
contains the result of a math operation that makes no sense. In fact, the name NaN is the acronym of
Not-A-Number. The built-in Number object just wraps a primitive numeric value and adds a method
to convert the number to a string.
The type string represents a sequence of zero or more characters. The content of a string is
bracketed in matching pairs of single or double quotes. The built-in String object adds a few methods,
including substring, which extracts a segment of the string between two specified indexes, and
toLowerCase , which converts characters in the string to lowercase.
Table 4-1 summarizes other built-in objects.
can access members by index and also add and remove existing elements.
Supplies a variety of handy methods to work with a date, including getting and
setting individual elements such as day, month, or year. It also works to deal with
Supplies an interface to perform a variety of mathematical tasks ranging from
getting random numbers to power, and from rounding to min/max and absolute
Supplies regular expressions.
functions of the global object augment all native and custom objects. In particular, the global object
features the following properties:
NaN, which returns the value for Not-A-Number.
Infinity, which returns the value for infinity.
Table 4-2 lists the functions available on the global object.