Effective JavaScript

David Herman

出版时间

2012-12-06

ISBN

9780321812186

评分

★★★★★
书籍介绍
"It's uncommon to have a programming language wonk who can speak in such comfortable and friendly language as David does. His walk through the syntax and semantics of JavaScript is both charming and hugely insightful; reminders of gotchas complement realistic use cases, paced at a comfortable curve. You'll find when you finish the book that you've gained a strong and comprehensive sense of mastery." -Paul Irish, developer advocate, Google Chrome "This is not a book for those looking for shortcuts; rather it is hard-won experience distilled into a guided tour. It's one of the few books on JS that I'll recommend without hesitation." -Alex Russell, TC39 member, software engineer, Google In order to truly master JavaScript, you need to learn how to work effectively with the language's flexible, expressive features and how to avoid its pitfalls. No matter how long you've been writing JavaScript code, Effective JavaScript will help deepen your understanding of this powerful language, so you can build more predictable, reliable, and maintainable programs. Author David Herman, with his years of experience on Ecma's JavaScript standardization committee, illuminates the language's inner workings as never before-helping you take full advantage of JavaScript's expressiveness. Reflecting the latest versions of the JavaScript standard, the book offers well-proven techniques and best practices you'll rely on for years to come. Effective JavaScript is organized around 68 proven approaches for writing better JavaScript, backed by concrete examples. You'll learn how to choose the right programming style for each project, manage unanticipated problems, and work more successfully with every facet of JavaScript programming from data structures to concurrency. Key features include * Better ways to use prototype-based object-oriented programming * Subtleties and solutions for working with arrays and dictionary objects * Precise and practical explanations of JavaScript's functions and variable scoping semantics * Useful JavaScript programming patterns and idioms, such as options objects and method chaining * In-depth guidance on using JavaScript's unique "run-to-completion" approach to concurrency
AI导读
核心看点
  • 作者为JS规范专家,内容权威且深入。
  • 涵盖作用域、原型等核心概念,干货满满。
  • 提供大量实战建议,帮助规避常见陷阱。
适合谁读
  • 具备一定经验,希望进阶的前端开发者。
  • 想深入理解JS底层机制与规范的技术人员。
  • 追求代码质量,希望写出健壮JS代码者。
读前提醒
  • 部分技术细节已随ES6+更新,需留意时效。
  • 建议结合现有项目代码对照阅读,效果更佳。
  • 内容较深,适合反复翻阅,不宜一次性速读。
读者共识
  • Effective系列经典,对得起其高口碑。
  • 讲解生动不枯燥,是JS进阶必读好书。
  • 部分观点有争议,需辩证看待并批判吸收。

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "The specification mistake, which existed through ES3, was that JavaScript engines were required to represent the scope of a named function expression as an object, much like the problematic with construct. This program looks like it should produce null, but it actually produces a new object, because"
  • "The other kind of call to eval is considered “indirect,” and evaluates its argument in global scope."
  • "A concise way to write an indirect call to eval is to use the expression sequencing operator (,) with an apparently pointless number literal:"
  • "a new arguments variable is implicitly bound in the body of each function.a The arguments object we are interested in is the one associated with the values function, but the iterator’s next method contains its own arguments variable. So when we return arguments[i++], we are accessing an argument of "
  • "JavaScript engines are not required to produce accurate reflections of function source code via `toString`"
  • "Different engines may produce different results from `toString`"
  • "Overloading two types means there must be a way to distinguish the cases. And it’s not possible to detect that a value implements a structural interface. This leads to the following rule: APIs should never overload structural types with other overlapping types"
  • "正常的作用域中,会有与局部作用域中的变量同样多的作用域绑定储存在与之对应的环境层级中。但对于with作用域,绑定集合依赖于碰巧在给定时间点的对象。"
用户评论
后面大部分内容都已经知道了,要是 2012 年看的话收获就非常大了。
啃书太慢怎么破....
对初学者很有用 但是更像是recipes 零零散散的知识点
好书
满满的干货,对于闭包closure, this以及异步concurrency讲的很透,能感觉到作者真正是厚积薄发
国内引进的英文版封面不是这样的。封面错了,拒绝写书评。
虽然有点过时,但是依然很有帮助!帮我理清了一些难懂的javascript概念
这本书的点太追求技术、太偏了,原理解释得也很蹩脚,不推荐。
收藏