There are two types of programing language – Synchronous and Asynchronous.
Every function will execute in sequential order. Each waiting for the first function/line of code to execute before it executes the next function or line of code.
let’s take a simple example ,
let a = 10; let b = 20; console.log(a); let sum = a+b; console.log(sum);
In this example , initially first line of console.log() will be execute. After execution of first line then sum will be printed.
Hello World! to the console. and then after 5s
Also we can use setInterval function which will print
So, setTimeout and setInterval are good example of Asynchronous.
Article written By: : Ankita Kataria.
Thank you !!
This Post Has 3 Comments
Id like to thank you for the efforts youve put in writing this website. I really hope to see the same high-grade blog posts from you in the future as well. In truth, your creative writing abilities has motivated me to get my own, personal site now 😉