- Synchronous → Code executes line by line (blocking).
- Asynchronous → Tasks (like API calls, setTimeout) run in the background without blocking code.
Example:
console.log("Start");
setTimeout(() => console.log("Async Task"), 2000);
console.log("End");
// Output: Start → End → (after 2 sec) Async Task
Leave a Reply