前言................................................................................................................................xv
第1 章 精华.................................................................................................................. 1
为什么要使用JavaScript .......................................................................................................2
分析JavaScript......................................................................................................................2
一个简单的试验场.................................................................................................................4
第2 章 语法.................................................................................................................. 5
空白.......................................................................................................................................5
标识符...................................................................................................................................6
数字.......................................................................................................................................7
字符串...................................................................................................................................8
语句.....................................................................................................................................10
表达式.................................................................................................................................15
字面量.................................................................................................................................18
函数.....................................................................................................................................19
第3 章 对象................................................................................................................ 20
对象字面量..........................................................................................................................20
检索.....................................................................................................................................21
更新.....................................................................................................................................22
引用.....................................................................................................................................22
原型.....................................................................................................................................22
反射.....................................................................................................................................23
枚举.....................................................................................................................................24
删除.....................................................................................................................................24
减少全局变量污染...............................................................................................................25
第4 章 函数................................................................................................................ 26
函数对象..............................................................................................................................26
函数字面量..........................................................................................................................27
调用.....................................................................................................................................27
参数.....................................................................................................................................30
返回.....................................................................................................................................31
异常.....................................................................................................................................31
扩充类型的功能...................................................................................................................32
递归.....................................................................................................................................33
作用域.................................................................................................................................36
闭包.....................................................................................................................................36
回调.....................................................................................................................................39
模块.....................................................................................................................................40
级联.....................................................................................................................................42
柯里化.................................................................................................................................43
记忆.....................................................................................................................................43
第5 章 继承................................................................................................................. 46
伪类.....................................................................................................................................46
对象说明符..........................................................................................................................49
原型.....................................................................................................................................50
函数化.................................................................................................................................51
部件.....................................................................................................................................55
第6 章 数组................................................................................................................. 57
数组字面量..........................................................................................................................57
长度.....................................................................................................................................58
删除.....................................................................................................................................59
枚举.....................................................................................................................................59
容易混淆的地方...................................................................................................................60
方法.....................................................................................................................................60
指定初始值..........................................................................................................................62
第7 章 正则表达式..................................................................................................... 64
一个例子..............................................................................................................................65
结构.....................................................................................................................................69
元素.....................................................................................................................................71
第8 章 方法................................................................................................................. 77
Array ....................................................................................................................................77
Function ...............................................................................................................................83
Number ................................................................................................................................84
Object...................................................................................................................................85
RegExp ................................................................................................................................86
String....................................................................................................................................88
第9 章 代码风格........................................................................................................ 94
第10 章 优美的特性................................................................................................... 98
附录A 毒瘤............................................................................................................... 101
附录B 糟粕............................................................................................................... 109
附录C JSLint ............................................................................................................. 115
附录D 语法图........................................................................................................... 127
附录E JSON............................................................................................................... 138
索引.............................................................................................................................. 149
· · · · · · (
收起)