stephansun对《JavaScript》的笔记(3)

stephansun
stephansun (认真你就输了...)

读过 JavaScript

JavaScript
  • 书名: JavaScript
  • 作者: Douglas Crockford
  • 副标题: The Good Parts
  • 页数: 172
  • 出版社: Yahoo Press
  • 出版年: 2008-5
  • 第10页
    Unlike many other languages, blocks in JavaScript do not create a new scope, so variables should be defined at the top of the function, not in blocks.
    2012-12-20 16:55:52 回应
  • 第29页
    JavaScript是一门基于原型继承的语言。这意味着对象可以直接从其他对象继承属性。该语言是无类别的。
    这偏离了当今编程语言的主流。当今大多数语言都是基于类的语言。尽管原型继承有着强大的表现力,但它并不被广泛理解。JavaScript本身对其原型的本质也缺乏信心,所以它提供了一套和基于类语言类似的对象构造语法。有类型化编程语言经验的程序员们很少有愿意接受原型继承的,并且认为借鉴类型化语言的语法模糊了这门语言真实的原型本质。真是两边都不讨好。
    2012-12-21 14:27:17 回应
  • 第35页
    Some languages offer the tail recursion optimization. This means that if a function returns the result of invoking itself recursively, then the invocation is replaced with a loop, which can significantly speed things up. Unfortunately, JavaScript does not currently provide tail recursion optimization. Functions that recurse very deeply can fail by exhausting the return stack:
    2013-08-22 06:40:07 回应