Skip to content

Commit e210b18

Browse files
Update synchronous_asynchronous.js
1 parent 1b266c7 commit e210b18

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

part9_Advanced/synchronous_asynchronous.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
/*
2-
1️⃣ Synchronous vs. Asynchronous JavaScript (Basic Concept)
3-
🔹 Synchronous: Code executes line by line, blocking further execution until a task completes.
4-
🔹 Asynchronous: Code does not wait, allowing other tasks to continue while waiting for an operation to finish.
5-
*/
6-
7-
/*
8-
1️⃣ What is the Event Loop?
9-
The Event Loop is what allows JavaScript to handle asynchronous operations without blocking execution. It enables JavaScript to run single-threaded, yet still perform non-blocking I/O operations, like handling API requests, setTimeout, and user interactions.
10-
*/
11-
12-
/*
13-
Call Stack
14-
JavaScript uses a Call Stack to keep track of function execution.
15-
16-
When a function is called, it's added to the stack.
17-
When a function completes, it's removed from the stack.
18-
If a function calls another function, the new function is added on top of the stack.
19-
*/
20-
211
const startTime = Date.now();
222
let currentTime = startTime;
233

0 commit comments

Comments
 (0)