Javascript忍者秘术精要 翻译自Secrets of Javascript Ninja,摘要其中最精妙的部分进行翻译 Part 2 3 Functions are fundamental (函数是基础) 函数式的区别在哪 What’s with the functional difference? 函数声明 Declarations 函数调用 Invocations 4 Wielding functions (挥舞函数) 匿名函数 Anonymous functions 递归 Recursion 把函数当对象玩 变长参数列表 检查函数 6 Object-orientation with prototypes (用原型实现面向对象) 初始化和原型 Instantiation and prototypes 陷阱们 The gotchas! 设计类体系 Writing class-like code 总结 Summary 7 Wrangling regular expressions (修炼正则表达式) 为什么使用正则 正则用法 编译正则表达式 正则捕获 函数替换 使用正则解决实际问题 8 Taming threads and timers (驯服线程和计时器) 计时器和线程如何工作 可靠的最小延时 处理计算密集性任务 中央计时控制器 异步测试 Part 3 9 Ninja alchemy: runtime code evaluation (忍者点金术:动态代码解析) 执行机制 函数反编译 代码解析的实际应用