Chapter 4
The Basics
of JavaScript
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-2
TABLE 4.1
The Reserved Words of JavaScript
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-3
FIGURE 4.1 Primitives and objects
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-4
TABLE 4.2 Precedence and Associativity
of the Numeric Operators
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-5
TABLE 4.3 Properties of Number
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-6
TABLE 4.4 String Methods
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-7
TABLE 4.5 Methods for the Date Object
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-8
TABLE 4.5
Methods for the Date Object (Continued)
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-9
FIGURE 4.2 An example of the output of
document.write
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-10
FIGURE 4.3
An example of the output of alert
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-11
FIGURE 4.4
An example of the output of confirm
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-12
FIGURE 4.5
An example of the output of prompt
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-13
TABLE 4.6 Relational Operators
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-14
TABLE 4.7
Operator Precedence and Associativity
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-15
FIGURE 4.6
Dialog box from borders2.html
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-16
FIGURE 4.7 Display of borders2.html
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-17
FIGURE 4.8 Display of date.html
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-18
FIGURE 4.9
Display of nested_arrays.html
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-19
FIGURE 4.10 Display of parameters.html
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-20
FIGURE 4.11 Display of medians.html
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-21
TABLE 4.8 Predefined Character Classes
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-22
FIGURE 4.12
Display of forms_check.html
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.
4-23
FIGURE 4.13 Display of debugdemo.html
with Internet Explorer 6
Copyright © 2006 Pearson Addison-Wesley. All rights reserved.