DEV Community

SILAMBARASAN A
SILAMBARASAN A

Posted on

set time

What is Asynchronous?

Asynchronous JavaScript means
πŸ‘‰ long time edukkura work nadakkumbodhu
πŸ‘‰ JavaScript wait pannaama next line execute pannum.

⏱ setTimeout() – Asynchronous Example
console.log("Start");

setTimeout(function () {
console.log("This runs after 2 seconds");
}, 2000);

console.log("End");

🟒 Output:
Start
End
This runs after 2 seconds

πŸ‘‰ setTimeout background-la wait pannum
πŸ‘‰ JS next line (End) immediately run aagum

🧠 Why this is Asynchronous?

setTimeout time wait pannum

JS block aagama continue pannum

So idhu asynchronous behavior

Top comments (0)