十五的學習日記20161003 promise相關

2022-09-09 02:33:16 字數 425 閱讀 7771

還是promise.

昨天沒寫完,今天好好寫.

promise的關鍵在於,每一步都要構造並返回promise物件.

示例**

// 0.5秒後返回input*input的計算結果:

function multiply(input) );

}// 0.5秒後返回input+input的計算結果:

function add(input) );

}var p = new promise(function (resolve, reject) );

p.then(multiply)

.then(add)

.then(multiply)

.then(add)

.then(function (result) );

Spring學習日記十五 MVC 總結篇

spring 並不會強制應用對 web 框架的選擇,但對於 web 應用開發而言,選擇直接使用 spring mvc 可以給應用開發帶來許多便利。而對於整個 spring mvc 框架的執行過程,首先,在 web 環境中建立 sping ioc 容器的 web 容器中的配置和初始化,當然,因為 we...

學習Python 十五

學習位址 前面工作許多事情耽誤了繼續學習python,都去學習其他知識了,現在重新撿起 程序池import multiprocessing as mul def f x return x 2 pool mul.pool 5 rel pool.map f,1,2,3,4,5,6,7,8,9,10 pr...

python的學習日記

今天在看python基礎的時候搞明白了乙個很小的點,但也是乙個進步。下面 回答輸出的結果是什麼?為什麼?result lambda x x i for i in range 10 print result 0 10 答案是19,而且不論print的時候result 0 9 都會是19 當然如果輸入r...