doc: add callbacks section

This commit is contained in:
Leon Xu committed 2021-10-17 12:21:50 -07:00
1 parent 8054179f04
commit 42d44f2ff1
1 file changed
+8 -1
+8 -1
View File
@@ -85,4 +85,11 @@ verifyPizza();
eatPizza();
// twiddle thumbs
payForPizza();
```
```
# 回调
回调在事件驱动编程中是一个非常强大的特性。
- 比例:在电话答录机上留下你的电话号码
为什么你认为在JavaScript语言中有能力将回调函数作为参数传递给其他函数,如JS中的addEventListener和setTimeout是有用的?
- 使异步执行!