Async JavaScript / JavaScript Garden / Eloquent JavaScript

Table of Contents

1

1.1 Meta Notes

1.2 Books

1.2.1 DONE Combo #1

  1. DONE 金字塔原理
  2. TODO Beast Machines: Transformers (cartoon)
  3. DONE 论持久战
  4. DONE 一看就懂的经济常识全图解
  5. DONE 刻意练习
  6. DONE 系统之美
  7. DONE 邓小平时代

1.2.2 INPROGRESS Combo #2

  1. DONE 新经济, 新规则 (Kevin Kelly)
  2. DONE 麦肯锡问题解决方法与技巧
  3. DONE 国产遥感卫星进展与应用

1.2.5 INPROGRESS Effective Java

1.2.6 DONE Don't Make Me Think

1.2.7 DONE Clean Code

1.2.8 INPROGRESS Deep Learning

1.2.9 INPROGRESS Async JavaScript

1.2.10 INPROGRESS ng-book2

1.2.11 INPROGRESS Combo #3: SLAM

2 Async JavaScript

2.1 Acknowledgments

Table of Contents

  • Acknowledgments
  • Introduction
  • Understanding JavaScript Events
  • Distributing Events
  • Promises and Deferreds
  • Flow Control with Async.js
  • Multithreading with Workers .
  • Async Script Loading
  • Tools for Taming JavaScript

2.2 Introduction

When did JavaScript become a respectable language? Some say the turning point was Gmail (2004), which showed the world that with a heavy dose of Ajax you could run a first-class email client in the browser. Others say that it was jQuery (2006), which abstracted the rival browser APIs of the time to create a de facto standard. (As of 2011, 48 percent of the top 17,000 websites use jQuery.)

Thanks to the ubiquity of web browsers, JavaScript has come closer than any other language to fulfilling Java’s old promise of “write once, run any- where.”

In 2007, Jeff Atwood coined Atwood’s law:

Any application that can be written in JavaScript will eventually be written in JavaScript.

Keywords like typeof, arguments, and this shouldn't faze you.

2.3 Understanding JavaScript Events

2.3.1 Scheduling Events

2.3.2 Types of Async Functions

2.3.3 Writing Async Functions

2.3.4 Handling Async Errors

2.3.5 Un-nesting Callbacks

2.3.6 What We've Learned

2.4 Distributing Events

2.4.1 PubSub

2.4.2 Evented Models

2.4.3 Custom jQuery Events

2.4.4 What We've Learned

2.5 Promises and Deferreds

2.5.1 A Very Brief History of Promises

2.5.2 Making Promises

2.5.3 Passing Data to Callbacks

2.5.4 Progress Notifications

2.5.5 Combining Promises

2.5.6 Binding to the Future with pipe

2.5.7 jQuery vs. Promises/A

2.5.8 Replacing Callbacks with Promises

2.5.9 What We’ve Learned

2.6 Flow Control with Async.js

2.6.1 The Async Ordering Problem

2.6.2 Async Collection Methods

2.6.3 Organizing Tasks with Async.js

2.6.4 Dynamic Async Queuing

2.6.5 Minimalist Flow Control with Step

2.6.6 What We’ve Learned

2.7 Multithreading with Workers .

2.7.1 Web Workers

2.7.2 Node Workers with cluster

2.7.3 What We’ve Learned

2.8 Async Script Loading

2.8.1 Limitations and Caveats

2.8.2 Reintroducing the <script> Tag

2.8.3 Programmatic Loading

2.8.4 What We’ve Learned

2.9 Tools for Taming JavaScript A1.1 TameJS

2.9.1 StratifiedJS

2.9.2 Kaffeine

2.9.3 Streamline.js

2.9.4 Node-Fibers

2.9.5 The Future of JavaScript: Generators

3 JavaScript Garden

http://bonsaiden.github.io/JavaScript-Garden/

  • JavaScript 中所有变量都可以当作对象使用,除了两个例外 null 和 undefined。
  • 删除属性的唯一方法是使用 delete 操作符;设置属性为 undefined 或者 null 并不能真正的删除属性, 而仅仅是移除了属性和值的关联。
    var obj = {
        bar: 1,
        foo: 2,
        baz: 3
    };
    obj.bar = undefined;
    obj.foo = null;
    delete obj.baz;
    
    for(var i in obj) {
        if (obj.hasOwnProperty(i)) {
    	console.log(i, '' + obj[i]);
        }
    }
    

4 Eloquent JavaScript

Author: TANG ZhiXiong

Created: 2018-09-05 Wed 10:55

Emacs 25.3.2 (Org mode 8.2.10)

Validate