𝔖 Scriptorium
✦   LIBER   ✦

📁

JavaScript: the Definitive Guide:Activate Your Web Pages

✍ Scribed by Flanagan, David


Publisher
O'Reilly Media, Incorporated
Year
2011
Tongue
English
Leaves
1098
Edition
6th ed
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Since 1996,JavaScript: The Definitive Guidehas been the bible for JavaScript programmers—a programmer's guide and comprehensive reference to the core language and to the client-side JavaScript APIs defined by web browsers. The 6th edition covers HTML5 and ECMAScript 5, with new chapters on jQuery and server side JavaScript. It's recommended for experienced programmers who want to learn the programming language of the Web, and for current JavaScript programmers who want to master it.

✦ Table of Contents


Table of Contents......Page 9
Preface......Page 15
Example Code......Page 16
Acknowledgments......Page 17
Chapter 1. Introduction to JavaScript......Page 19
1.1  Core JavaScript......Page 22
1.2  Client-Side JavaScript......Page 26
1.2.1  Example: A JavaScript Loan Calculator......Page 30
Part I. Core JavaScript......Page 37
2.1.1  Case Sensitivity......Page 39
2.1.4  Normalization......Page 40
2.4  Identifiers and Reserved Words......Page 41
2.4.1  Reserved Words......Page 42
2.5  Optional Semicolons......Page 43
Chapter 3. Types, Values, and Variables......Page 47
3.1  Numbers......Page 49
3.1.2  Floating-Point Literals......Page 50
3.1.3  Arithmetic in JavaScript......Page 51
3.1.4  Binary Floating-Point and Rounding Errors......Page 52
3.1.5  Dates and Times......Page 53
3.2.1  String Literals......Page 54
3.2.2  Escape Sequences in String Literals......Page 55
3.2.3  Working with Strings......Page 56
3.2.4  Pattern Matching......Page 57
3.3  Boolean Values......Page 58
3.4  null and undefined......Page 59
3.5  The Global Object......Page 60
3.6  Wrapper Objects......Page 61
3.7  Immutable Primitive Values and Mutable Object References......Page 62
3.8  Type Conversions......Page 63
3.8.2  Explicit Conversions......Page 65
3.8.3  Object to Primitive Conversions......Page 67
3.9.1  Repeated and Omitted Declarations......Page 70
3.10.1  Function Scope and Hoisting......Page 71
3.10.3  The Scope Chain......Page 73
4.1  Primary Expressions......Page 75
4.2  Object and Array Initializers......Page 76
4.3  Function Definition Expressions......Page 77
4.4  Property Access Expressions......Page 78
4.6  Object Creation Expressions......Page 79
4.7  Operator Overview......Page 80
4.7.1  Number of Operands......Page 81
4.7.4  Operator Side Effects......Page 82
4.7.6  Operator Associativity......Page 83
4.8  Arithmetic Expressions......Page 84
4.8.1  The + Operator......Page 85
4.8.2  Unary Arithmetic Operators......Page 86
4.8.3  Bitwise Operators......Page 87
4.9.1  Equality and Inequality Operators......Page 89
4.9.2  Comparison Operators......Page 91
4.9.4  The instanceof Operator......Page 92
4.10.1  Logical AND (&&)......Page 93
4.10.2  Logical OR (||)......Page 94
4.11  Assignment Expressions......Page 95
4.11.1  Assignment with Operation......Page 96
4.12  Evaluation Expressions......Page 97
4.12.2  Global eval()......Page 98
4.12.3  Strict eval()......Page 99
4.13.2  The typeof Operator......Page 100
4.13.3  The delete Operator......Page 102
4.13.5  The Comma Operator (,)......Page 103
Chapter 5. Statements......Page 105
5.2  Compound and Empty Statements......Page 106
5.3  Declaration Statements......Page 107
5.3.1  var......Page 108
5.3.2  function......Page 109
5.4.1  if......Page 110
5.4.2  else if......Page 112
5.4.3  switch......Page 113
5.5.1  while......Page 115
5.5.3  for......Page 116
5.5.4  for/in......Page 118
5.5.4.1  Property enumeration order......Page 119
5.6.1  Labeled Statements......Page 120
5.6.2  break......Page 121
5.6.3  continue......Page 122
5.6.5  throw......Page 123
5.6.6  try/catch/finally......Page 124
5.7.1  with......Page 126
5.7.2  debugger......Page 127
5.7.3  “use strict”......Page 128
5.8  Summary of JavaScript Statements......Page 130
Chapter 6. Objects......Page 133
6.1  Creating Objects......Page 134
6.1.2  Creating Objects with new......Page 135
6.1.4  Object.create()......Page 136
6.2.1  Objects As Associative Arrays......Page 138
6.2.2  Inheritance......Page 140
6.2.3  Property Access Errors......Page 141
6.3  Deleting Properties......Page 142
6.4  Testing Properties......Page 143
6.5  Enumerating Properties......Page 144
6.6  Property Getters and Setters......Page 146
6.7  Property Attributes......Page 149
6.7.1  Legacy API for Getters and Setters......Page 152
6.8.1  The prototype Attribute......Page 153
6.8.2  The class Attribute......Page 154
6.8.3  The extensible Attribute......Page 155
6.10  Object Methods......Page 156
6.10.3  The toJSON() Method......Page 157
6.10.4  The valueOf() Method......Page 158
7.1  Creating Arrays......Page 159
7.2  Reading and Writing Array Elements......Page 160
7.4  Array Length......Page 162
7.5  Adding and Deleting Array Elements......Page 163
7.6  Iterating Arrays......Page 164
7.8  Array Methods......Page 166
7.8.3  sort()......Page 167
7.8.5  slice()......Page 168
7.8.7  push() and pop()......Page 169
7.8.9  toString() and toLocaleString()......Page 170
7.9.1  forEach()......Page 171
7.9.4  every() and some()......Page 172
7.9.5  reduce(), reduceRight()......Page 173
7.10  Array Type......Page 175
7.11  Array-Like Objects......Page 176
7.12  Strings As Arrays......Page 178
Chapter 8. Functions......Page 181
8.1  Defining Functions......Page 182
8.2  Invoking Functions......Page 184
8.2.2  Method Invocation......Page 185
8.2.4  Indirect Invocation......Page 188
8.3.1  Optional Parameters......Page 189
8.3.2  Variable-Length Argument Lists: The Arguments Object......Page 190
8.3.2.1  The callee and caller properties......Page 191
8.3.4  Argument Types......Page 192
8.4  Functions As Values......Page 194
8.5  Functions As Namespaces......Page 196
8.6  Closures......Page 198
8.7.2  The prototype Property......Page 204
8.7.3  The call() and apply() Methods......Page 205
8.7.4  The bind() Method......Page 206
8.7.5  The toString() Method......Page 207
8.7.6  The Function() Constructor......Page 208
8.8  Functional Programming......Page 209
8.8.1  Processing Arrays with Functions......Page 210
8.8.2  Higher-Order Functions......Page 211
8.8.3  Partial Application of Functions......Page 212
8.8.4  Memoization......Page 214
Chapter 9. Classes and Modules......Page 217
9.1  Classes and Prototypes......Page 218
9.2  Classes and Constructors......Page 219
9.2.2  The constructor Property......Page 221
9.3  Java-Style Classes in JavaScript......Page 223
9.4  Augmenting Classes......Page 226
9.5  Classes and Types......Page 227
9.5.1  The instanceof operator......Page 228
9.5.3  The Constructor Name......Page 229
9.5.4  Duck-Typing......Page 231
9.6.1  Example: A Set Class......Page 233
9.6.2  Example: Enumerated Types......Page 235
9.6.3  Standard Conversion Methods......Page 237
9.6.4  Comparison Methods......Page 239
9.6.5  Borrowing Methods......Page 242
9.6.6  Private State......Page 244
9.6.7  Constructor Overloading and Factory Methods......Page 245
9.7  Subclasses......Page 246
9.7.1  Defining a Subclass......Page 247
9.7.2  Constructor and Method Chaining......Page 248
9.7.3  Composition Versus Subclassing......Page 251
9.7.4  Class Hierarchies and Abstract Classes......Page 252
9.8.1  Making Properties Nonenumerable......Page 256
9.8.2  Defining Immutable Classes......Page 257
9.8.4  Preventing Class Extensions......Page 259
9.8.5  Subclasses and ECMAScript 5......Page 260
9.8.6  Property Descriptors......Page 261
9.9.1  Objects As Namespaces......Page 264
9.9.2  Function Scope As a Private Namespace......Page 266
10.1  Defining Regular Expressions......Page 269
10.1.1  Literal Characters......Page 270
10.1.2  Character Classes......Page 271
10.1.3  Repetition......Page 272
10.1.3.1  Nongreedy repetition......Page 273
10.1.4  Alternation, Grouping, and References......Page 274
10.1.5  Specifying Match Position......Page 275
10.2  String Methods for Pattern Matching......Page 277
10.3  The RegExp Object......Page 279
10.3.2  RegExp Methods......Page 280
Chapter 11. JavaScript Subsets and Extensions......Page 283
11.1.2  Subsets for Security......Page 284
11.2  Constants and Scoped Variables......Page 287
11.3  Destructuring Assignment......Page 289
11.4.2  Iterators......Page 292
11.4.3  Generators......Page 295
11.4.4  Array Comprehensions......Page 298
11.4.5  Generator Expressions......Page 299
11.5  Shorthand Functions......Page 300
11.7  E4X: ECMAScript for XML......Page 301
12.1  Scripting Java with Rhino......Page 307
12.1.1  Rhino Example......Page 311
12.2  Asynchronous I/O with Node......Page 314
12.2.1  Node Example: HTTP Server......Page 318
12.2.2  Node Example: HTTP Client Utilities Module......Page 320
Part II. Client-Side JavaScript......Page 323
13.1  Client-Side JavaScript......Page 325
13.1.2  JavaScript in Web Applications......Page 328
13.2  Embedding JavaScript in HTML......Page 329
13.2.1  The