diff --git a/source/_posts/Timing.md b/source/_posts/Timing.md index 3e1fc29..004bbf1 100644 --- a/source/_posts/Timing.md +++ b/source/_posts/Timing.md @@ -11,3 +11,14 @@ cover: >- abbrlink: 142d93dd date: 2021-10-01 18:59:39 --- +# 倒数 — 一个经典的循环问题 +```javascript +function startCountDown() { + let count = 10; + for (let i = count; i > 0; i--) { + console.log(i + '...'); + } + console.log("0!"); +} +``` +一旦它被调用,就会在控制台打印一个倒计时。但是如果我们想要将打印的每一行延迟1秒呢? \ No newline at end of file