Divides one thing entire to many objects;Like perspectives, which rightly gazed uponShow nothing but confusion. . .—William Shakespeare, The Tragedy of King Richard the Second Inheritance is an important topic in most programming languages. In the cl…
最近在看JavaScript框架设计,在讲解类型判定的时候提到了一些“匪夷所思的情况”,不过没有明说都是什么时候会出现这些情况.自己玩儿了一下,写写随笔吧.不过可能除了我找到的,还有会其他时候会出现这些诡异的现象2333 问题:在JavaScript中,什么时候会出现 a !== a a == b && b != a a == !a a == b && a == c && b != c a != b && a != c &&…
Why, every fault’s condemn’d ere it be done:Mine were the very cipher of a function. . .—William Shakespeare, Measure for Measure The best thing about JavaScript is its implementation of functions. It got almost everything right. But, as you should e…
Chapter 1 Good Parts: JavaScript is an important language because it is the language of the web browser. The very good ideas include functions, loose typing, dynamic objects, and an expressive object literal notation. The bad ideas include a programm…
I know it well:I read it in the grammar long ago.—William Shakespeare, The Tragedy(悲剧:灾难:惨案) of Titus Andronicus This chapter introduces the grammar of the good parts of JavaScript, presenting a quick overview of how the language is structured. We wi…
提炼出一门语言或技术的 Good Parts, 使用该子集去构造健壮稳固的应用. 我们总是倾向于去学习和使用所有的语言特性,好像凡是新的,凡是提供了的, 就有必要去使用: 这本书告诉我们, 要有选择性地学习和使用. 不是所有的语言特性都需要学习和使用. 学习和使用那些设计不良的特性,不仅耗费大量时间和精力,而且有损项目的可维护性,得不偿失:反之,学习那些优良的部分,不仅可以节省时间,腾出更多时间和精力去做更重要的事情,而且有助于将事情做好,提高收益/学习比. 富有技巧性的HACKER可以欣赏其精…
In this chapter I present classes to represent playing cards, decks of cards, and poker hands.If you don't play poker, you can read about it at http://en.wikipedia.org/wiki/Poker, but you don’t have to; I’ll tell you what you need to know for the exe…
Thee(你) I’ll chase(追逐:追捕) hence(因此:今后), thou(你:尔,汝) wolf in sheep’s array.—William Shakespeare, The First Part of Henry the SixthAn array is a linear(线的,线型的:直线的,线状的:长度的) allocation(分配,配置:安置) of memory in which elements are accessed by integers that a…
Upon a homely object Love can wink.—William Shakespeare, The Two Gentlemen of Verona The simple types of JavaScript are numbers, strings, booleans (true and false), null,and undefined. All other values are objects. Numbers, strings, and booleans are …
1.2.2 文档对象模型     DHTML的出现让开发人员无需重新加载页面就可以修改其外观了. 1.2.3 浏览器对象模型(BOM)     BOM真正与众不同的地方在于他作为javascript实现的一部分,但是却没有相关的标准.这些问题咋html5中得到解决.     人们习惯上把所有针对浏览器的javascript扩展算作BOM 的一部分.      1.4 小结 来自为知笔记(Wiz)…