Effective JavaScript

赫尔曼 (David Herman)

出版时间

2013-12-31

ISBN

9787111446231

评分

★★★★★

标签

web编程

书籍介绍
这本书最见功力的地方,不在于教你JavaScript怎么用,而在于告诉你它为什么这么
作者简介
David Herman,资深 JavaScript 技术专家,Ecma TC39 委员会成员,负责JavaScript 的标准化工作。他拥有格林内尔学院的计算机科学学士学位和美国东北大学的计算机科学硕士及博士学位,现在 Mozilla 研究院担任高级研究员。
AI导读
核心看点
  • ECMA专家撰写,浓缩68条实践建议
  • 深度解析JS内部机制、陷阱与最佳实践
  • 涵盖作用域、函数、原型及并发等核心主题
读者共识
  • 内容权威实用,对编写高质量JS代码帮助大
  • 翻译质量参差不齐,部分代码存在勘误问题
  • 部分观点随ES6普及已过时,理念仍具参考价值
精彩摘录
  • "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作用域,绑定集合依赖于碰巧在给定时间点的对象。"
目录
本书赞誉
译者序
前言
第1章 让自己习惯JavaScript 1

显示全部
用户评论
和其他Effective 系列的书一样,书中的建议都很接地气,实用性很强,对于编写更好的JavaScript很有帮助。值得多看几遍,然后运用到实践中~
总结的很不错、合适进阶。
很棒,适合有一点基础的人看
有些老旧,但是理念还可借鉴,只是这翻译实在太差,真就直译?
如果用ES6,很多问题可以避免,不过了解一些ES5之前的内容还是有益的。
虽然有点久远,但是看完还是收获良多
整本书遇到的问题,其实在你有很好的编程习惯下就不会有差别。但是呢?随着es6和现在的es的更新,以及node的后端的发展,有些总结不太适用特定发展。比如说不要用同步的方式改写异步。这个在前端是正常的,但是后端的很多服务都是要求同步的,所以不太适用。
有些思路观点还是很经典的,但是有些内容的时效性已经不强了。现在有很好的方式可以避免提到的出错状况,所以有些地方建议略看一下就可以了。
精炼、实用
下载
收藏