Last active
March 14, 2018 04:14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Display an console log after 3 seconds (3000 milliseconds) | |
* 功能:進入setTimeout三秒後再顯示一行字 | |
* | |
*/ | |
setTimeout(function(){ console.log("wait after 3 seconds!"); }, 3000); // 等待三秒後輸出 | |
console.log("Hi!"); // 由於setTimeout是非同步函數,因此執行的同時便接著執行這行,導致這行先輸出 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment