The JavaScript pocket guide
✍ Scribed by Burdette, Lenny
- Publisher
- Peachpit Press
- Year
- 2010
- Tongue
- English
- Leaves
- 313
- Category
- Library
No coin nor oath required. For personal study only.
✦ Synopsis
JavaScript is an object-oriented scripting language that enables you to modify a document's structure, styling, and content in response to user actions. This handy pocket serves as both a quick introduction to the language and acts a valuable reference. It's packed with tips as well as JavaScript syntax, methods, and properties. Concise and inexpensive, it's exactly the guide many web designers and developers need.
✦ Table of Contents
Cover......Page 1
Contents......Page 6
Introduction......Page 18
Why JavaScript Is Cool......Page 19
What’s in This Book......Page 20
Resources......Page 21
Comments......Page 22
Reserved Words......Page 23
Firebug......Page 25
Chapter 1: JavaScript Basics......Page 28
Expressions and Statements......Page 29
Variables and Data......Page 30
Values......Page 31
Comparison......Page 32
Truthiness and Falsiness......Page 33
Functions and Objects......Page 35
Objects......Page 36
Loops......Page 37
if/if-else/else......Page 38
switch/case......Page 39
throw......Page 40
break and continue......Page 41
Logical NOT: !......Page 42
Logical AND: &&......Page 43
Logical OR: ||......Page 44
Combining Boolean Operators......Page 45
Ternary Expressions......Page 46
Chapter 2: Numbers......Page 48
Basic Math......Page 49
Number Formats......Page 51
The Math Object......Page 52
Conversion......Page 53
Number Precision......Page 56
Chapter 3: Strings......Page 58
Operators......Page 59
Methods......Page 60
charAt(x), charCodeAt(x)......Page 61
slice(x[, y])......Page 62
Converting Strings to Arrays: split([delimiter, limit])......Page 63
indexOf(substring[, start])......Page 64
lastIndexOf(substring[, start])......Page 66
replace(pattern, replacement)......Page 67
escape(string), unescape(string)......Page 69
encodeURIComponent(string), decodeURIComponent(string)......Page 70
Chapter 4: Arrays......Page 72
Properties......Page 73
Looping Over Arrays......Page 74
forEach(loopFunc)......Page 75
Adding Items to Arrays......Page 76
unshift(x[,y,z …])......Page 77
Extracting Items from Arrays......Page 78
splice(start[, length, newValue …])......Page 79
Ordering Arrays......Page 80
sort([func])......Page 81
join([delimiter])......Page 82
toString()......Page 83
Chapter 5: Functions......Page 84
Expressions......Page 85
Self-invoking Functions......Page 86
Arguments......Page 87
Default Values for Arguments......Page 88
Objects as Arguments......Page 90
Return Values......Page 92
Functions as Methods......Page 93
Context Binding......Page 95
Closures......Page 97
Recursion......Page 101
Caching......Page 102
Memoization......Page 104
Chapter 6: Objects......Page 106
Basics......Page 107
Looping Over Properties......Page 108
Enumerable Properties......Page 110
Deleting Properties......Page 112
Constructor Functions......Page 113
Prototypes......Page 114
Changing Built-in Prototypes......Page 116
Adding Modern JavaScript to Older Browsers......Page 117
Prototypes for Custom Data Types......Page 118
How to Understand Constructor Functions and Prototypes......Page 119
Object-Oriented Patterns......Page 121
Namespacing......Page 123
Local References......Page 125
Chapter 7: The Global Object......Page 126
Global Variables......Page 127
Accidentally Creating Global Variables......Page 128
setTimeout(func, delay)......Page 129
setInterval(func, delay)......Page 130
clearInterval(id), clearTimeout(id)......Page 131
Chapter 8: Client-Side Scripting......Page 134
Remote Scripts......Page 135
Where to Include the