![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Web
文章平均质量分 84
wenbois2000
这个作者很懒,什么都没留下…
展开
-
JavaScript: The Good Parts 读书笔记(一)
一.基础特性在浏览器中,每个<script> 块都被解释成一个编译单元,因为缺少链接器。Javascript 把它们一起抛入一个公共的全局名称空间中(window).进行布尔判断时: false, null, undefined, 空串(""), 数字0, 数字NaN 均被看做 不成立javascript 的switch 语句允许case 字符串for in 语句会枚...原创 2011-01-26 21:44:29 · 153 阅读 · 0 评论 -
High Performance JavaScript 读书笔记(六)
六.Responsive Interfaces There’s nothing more frustrating than clicking something on a web page and having nothing happen. This problem goes back to the origin of transactional web applications and r...原创 2011-02-27 20:49:51 · 275 阅读 · 0 评论 -
High Performance JavaScript 读书笔记(四)
四.Algorithms and Flow Control The overall structure of your code is one of the main determinants as to how fast it will execute. Having a very small amount of code doesn’t necessarily mean that it ...原创 2011-02-27 19:50:22 · 226 阅读 · 0 评论 -
High Performance JavaScript 读书笔记(三)
三.DOM Scripting DOM scripting is expensive, and it’s a common performance bottleneck in rich web applications. This chapter discusses the areas of DOM scripting that can have a negative effect on an...原创 2011-02-27 14:43:40 · 228 阅读 · 0 评论 -
High Performance JavaScript 读书笔记(一)
一.Loading and Execution JavaScript performance in the browser is arguably the most important usability issue facing developers. The problem is complex because of the blocking nature of JavaScript, w...原创 2011-02-27 13:44:04 · 111 阅读 · 0 评论 -
JavaScript 数据访问(翻译自High Performance Javascript 第二章)
计算机科学中一个经典的问题是决定如何存储数据,以便进行快速的读取和写入操作。 在代码执行期间,数据如何存储将会关系到它们的检索速度。在Javascript中,由于只存在少数的操作来进行数据存储, 这个问题似乎 变得简单了。但是,与其他语言一样,Javascript中数据的存储方式将决定它们访问速度。下面是Javascript中可以进行数据存储的四种基本方式: 字面量值(Li...2011-02-27 13:21:33 · 117 阅读 · 0 评论 -
JavaScript Patterns 读书笔记(七)
7.Client PatternDOM Access DOM access is expensive; it’s the most common bottleneck when it comes to JavaScript performance. This is because the DOM is usually implemented separately from the Jav...原创 2011-02-15 20:32:43 · 484 阅读 · 0 评论 -
JavaScript Patterns 读书笔记(六)
6.Design PatternSingleton The idea of the singleton pattern is to have only one instance of a specific class. This means that the second time you use the same class to create a new object, you s...原创 2011-02-15 19:38:34 · 118 阅读 · 0 评论 -
JavaScript Patterns 读书笔记(五)
5.Inheritance PatternClassical Pattern #1—The Default Pattern The default method most commonly used is to create an object using the Parent() constructor and assign this object to the Child()’...原创 2011-02-15 19:08:07 · 112 阅读 · 0 评论 -
JavaScript Patterns 读书笔记(四)
4.Function PatternNamespace Pattern Namespaces help reduce the number of globals required by our programs and at the same time also help avoid naming collisions or excessive name prefixing. Jav...原创 2011-02-15 18:19:08 · 190 阅读 · 0 评论 -
JavaScript Patterns 读书笔记(二)
二.ObjectObject Constructor Catch You have no reason to use the new Object() constructor when you can use an object literal, but you might be inheriting legacy code written by others, so you shoul...原创 2011-02-14 21:20:08 · 105 阅读 · 0 评论 -
JavaScript Patterns 读书笔记(三)
三.FunctionBackground There are two main features of the functions in JavaScript that make them special—the first is that functions are first-class objects and the second is that they provide sc...原创 2011-02-14 21:19:58 · 175 阅读 · 0 评论 -
JavaScript Patterns 读书笔记(一)
一.Global全局域中的this = window.myglobal = "hello"; // antipatternconsole.log(myglobal); // "hello"console.log(window.myglobal); // "hello"console.log(window["myglobal"]); // "hello"console.log(...原创 2011-02-14 20:09:36 · 116 阅读 · 0 评论 -
JavaScript: The Good Parts 读书笔记(五)
五.Javascript 总结 语言精华:函数是头等对象, 函数是有词法作用域的闭包(Lambda).基于原型继承的动态对象, 对象是无类别的,可以通过普通的复制给任何对象添加一个新成员.一个对象可以从另一个对象继承成员元素.对象字面变量和数组字面变量, 这对创建新的对象和数组来说是一种非常方便的表示法.语言糟粕:全局变量 Javascript中最糟糕的特性...原创 2011-01-27 12:56:05 · 98 阅读 · 0 评论 -
JavaScript: The Good Parts 读书笔记(四)
四.数组与正则表达式 数组: 在一般的编程语言中,数组表示的是一段线性分配的内存 . 它通过整数去计算偏移并访问其中的元素。在这种情况下,数组是很快的数据结构。 不幸的是, Javascript 并没有像数组这样的数据结构。反而, Javascript 提供了一种类似数组的对象 ,这些对象包含了一些拥有数组特征的方法。它把数组的下标转变成字符串 ,用其作为属性 。它明显地比一个...原创 2011-01-27 11:37:41 · 98 阅读 · 0 评论 -
JavaScript: The Good Parts 读书笔记(三)
三.继承概述 Javascript 是一门弱类型语言,对象的起源是无关紧要的。对于一个对象来说重要的是它能做什么,而不是它从哪里来。Javascript 提供了一套丰富的代码重用模式。它可以模拟那些基于类的模式,同时它也可以支持其他更具表现力的模式. 在JS中可能的继承模式有很多。在这里,我们将研究几种最为直接的模式. 在基于类的语言中,对象是类的实例,并且类可以从另一个类继承。而J...原创 2011-01-26 23:38:02 · 105 阅读 · 0 评论 -
JavaScript: The Good Parts 读书笔记(二)
二.函数JS 中函数亦是对象 使用字面变量表面法产生的对象被链接到Object.prototype.而函数对象将会链接到 Function.prototype.(该原型对象本身也是连接到 Object.prototype). 每个函数在创建时将会附有个隐藏属性: 函数的执行上下文(function context) 和 实现函数行为的代码(!).每个函数对象在创建时也随带...原创 2011-01-26 23:01:14 · 141 阅读 · 0 评论 -
High Performance JavaScript 读书笔记(五)
五.Strings and Regular Expressions Practically all JavaScript programs are intimately tied to strings. For example, many applications use Ajax to fetch strings from a server, convert those strings in...原创 2011-02-27 21:24:05 · 513 阅读 · 0 评论