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)