From 2f663405cacf4694385902c8efb79ee503bfa5a8 Mon Sep 17 00:00:00 2001 From: Leon Xu <6479451-leonxu260@users.noreply.gitlab.com> Date: Sun, 17 Oct 2021 12:21:50 -0700 Subject: [PATCH] doc: add callbacks section --- source/_posts/异步JavaScript.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/_posts/异步JavaScript.md b/source/_posts/异步JavaScript.md index 2d384d0..cb56aeb 100644 --- a/source/_posts/异步JavaScript.md +++ b/source/_posts/异步JavaScript.md @@ -85,4 +85,11 @@ verifyPizza(); eatPizza(); // twiddle thumbs payForPizza(); -``` \ No newline at end of file +``` + +# 回调 +回调在事件驱动编程中是一个非常强大的特性。 +- 比例:在电话答录机上留下你的电话号码 + +为什么你认为在JavaScript语言中有能力将回调函数作为参数传递给其他函数,如JS中的addEventListener和setTimeout是有用的? +- 使异步执行! \ No newline at end of file