Author |
|
xiii | |
Preface |
|
xv | |
Versions of JavaScript |
|
xvii | |
|
|
1 | (6) |
|
|
1 | (1) |
|
1.2 JavaScript in the Browser |
|
|
1 | (1) |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
4 | (1) |
|
|
4 | (3) |
|
Chapter 2 JavaScript: The Bare Minimum |
|
|
7 | (42) |
|
|
7 | (1) |
|
|
8 | (9) |
|
|
8 | (1) |
|
2.2.2 User-Defined Objects |
|
|
9 | (1) |
|
2.2.3 Built-in Object Types |
|
|
9 | (1) |
|
|
9 | (2) |
|
|
11 | (1) |
|
|
11 | (1) |
|
|
12 | (2) |
|
2.2.8 Regular Expressions |
|
|
14 | (3) |
|
|
17 | (1) |
|
|
17 | (1) |
|
|
18 | (1) |
|
|
19 | (2) |
|
2.7 Equality and Identity |
|
|
21 | (1) |
|
|
22 | (1) |
|
|
22 | (20) |
|
|
22 | (1) |
|
|
23 | (1) |
|
2.9.3 Function Definitions |
|
|
24 | (1) |
|
2.9.4 Familiar Statements |
|
|
25 | (1) |
|
2.9.4.1 Assignment Statements |
|
|
26 | (1) |
|
|
27 | (1) |
|
2.9.4.3 Compound Statements |
|
|
27 | (1) |
|
|
28 | (1) |
|
|
29 | (1) |
|
|
30 | (1) |
|
2.9.4.7 Traditional for Loops |
|
|
31 | (1) |
|
|
32 | (1) |
|
2.9.4.9 Switch Statements |
|
|
33 | (2) |
|
2.9.4.10 Labeled Statements |
|
|
35 | (1) |
|
2.9.4.11 Break Statements |
|
|
35 | (1) |
|
2.9.4.12 Continue Statements |
|
|
36 | (1) |
|
2.9.4.13 Return Statements |
|
|
37 | (1) |
|
2.9.4.14 Empty Statements |
|
|
38 | (1) |
|
2.9.5 JavaScript-Specific Statements |
|
|
38 | (1) |
|
|
38 | (1) |
|
|
39 | (1) |
|
|
39 | (1) |
|
2.9.5.4 Try-catch-finally |
|
|
40 | (2) |
|
2.9.5.5 The with Statement |
|
|
42 | (1) |
|
2.10 Example: Prime Numbers |
|
|
42 | (1) |
|
|
43 | (6) |
|
2.11.1 The Mocha Test Framework |
|
|
43 | (2) |
|
|
45 | (1) |
|
|
46 | (3) |
|
Chapter 3 JavaScript: In More Detail |
|
|
49 | (60) |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
51 | (2) |
|
|
53 | (14) |
|
|
53 | (2) |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
57 | (2) |
|
|
59 | (1) |
|
|
59 | (1) |
|
|
60 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
63 | (2) |
|
|
65 | (2) |
|
|
67 | (1) |
|
|
68 | (1) |
|
|
69 | (2) |
|
|
71 | (1) |
|
|
72 | (1) |
|
|
73 | (12) |
|
3.10.1 Defining Functions |
|
|
73 | (2) |
|
3.10.2 Parameters and Arguments |
|
|
75 | (2) |
|
3.10.3 Functions Are Data |
|
|
77 | (1) |
|
3.10.4 Functions Are Objects |
|
|
78 | (1) |
|
|
79 | (1) |
|
|
80 | (2) |
|
|
82 | (1) |
|
|
83 | (2) |
|
|
85 | (22) |
|
3.11.1 Definition of Objects |
|
|
85 | (2) |
|
|
87 | (3) |
|
|
90 | (1) |
|
|
91 | (1) |
|
|
91 | (1) |
|
|
92 | (1) |
|
3.11.7 Higher-Order Functions |
|
|
93 | (2) |
|
|
95 | (1) |
|
|
96 | (2) |
|
3.11.10 Classes and Inheritance |
|
|
98 | (1) |
|
|
98 | (4) |
|
|
102 | (3) |
|
3.11.10.3 Overriding Methods and Fields |
|
|
105 | (1) |
|
3.11.10.4 Class Prototypes |
|
|
106 | (1) |
|
3.12 Transpilers and Polyfills |
|
|
107 | (1) |
|
|
108 | (1) |
|
Chapter 4 Client-Side JavaScript |
|
|
109 | (38) |
|
|
109 | (1) |
|
4.2 Adding JavaScript to HTML |
|
|
110 | (1) |
|
|
111 | (2) |
|
4.4 Graphical User Interfaces |
|
|
113 | (16) |
|
|
113 | (1) |
|
|
113 | (1) |
|
|
114 | (1) |
|
|
115 | (1) |
|
|
116 | (1) |
|
|
117 | (3) |
|
|
120 | (1) |
|
|
121 | (1) |
|
|
121 | (1) |
|
|
122 | (1) |
|
|
122 | (1) |
|
4.4.9 Additional Text Widgets |
|
|
122 | (2) |
|
4.4.10 Other Input Widgets |
|
|
124 | (1) |
|
|
125 | (4) |
|
|
129 | (1) |
|
|
129 | (18) |
|
|
129 | (1) |
|
4.5.1.1 Window Properties |
|
|
130 | (1) |
|
|
131 | (1) |
|
|
132 | (2) |
|
4.5.2 The Document Object |
|
|
134 | (1) |
|
4.5.2.1 Document Properties |
|
|
134 | (1) |
|
|
135 | (2) |
|
|
137 | (1) |
|
|
138 | (1) |
|
|
138 | (1) |
|
|
139 | (1) |
|
|
140 | (1) |
|
4.5.4.1 Element Properties |
|
|
140 | (1) |
|
|
140 | (2) |
|
|
142 | (1) |
|
|
142 | (5) |
Afterword |
|
147 | (2) |
Appendix A Array Methods |
|
149 | (2) |
Appendix B Higher-Order Methods |
|
151 | (2) |
Appendix C String Methods |
|
153 | (4) |
Appendix D Regular Expressions |
|
157 | (4) |
References |
|
161 | (2) |
Index |
|
163 | |