Last active
June 16, 2019 06:53
-
-
Save happymishra/257a289f17ceff75ceb070578795136c to your computer and use it in GitHub Desktop.
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
function printStatement() { | |
console.log("I will be printed after 100 milliseconds") | |
} | |
setTimeout(printStatement, 100) | |
/* ******* Alternate syntax ******************/ | |
/* | |
setTimeout can be written as this also | |
setTimeout(fucntion(){ | |
console.log("Hello") | |
}, 100) | |
*/ | |
/* ******* Alternate syntax ******************/ | |
console.log("I will be executed first") | |
/* Output: | |
I will be executed first | |
I will be printed after 100 milliseconds // After 100 millieconds | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment