Skip to content

Commit 312bbe4

Browse files
add javascript engine and environment
1 parent 83e661d commit 312bbe4

File tree

5 files changed

+109
-47
lines changed

5 files changed

+109
-47
lines changed

25_asynchronous_javascript/1_asynchronous_operation/asynchronous_operation.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ What
77

88
Why
99

10-
- **Improved Performance:** Prevents the program from freezing while waiting for long-running tasks.
11-
- **Better User Experience:** Maintains responsiveness and allows users to interact with the application while background tasks are in progress.
12-
- **Efficient Resource Utilization:** Enables handling multiple tasks concurrently.
10+
- Improved Performance: Prevents the program from freezing while waiting for long-running tasks.
11+
- Better User Experience: Maintains responsiveness and allows users to interact with the application while background tasks are in progress.
12+
- Efficient Resource Utilization: Enables handling multiple tasks concurrently.
1313

1414
How
1515

@@ -22,7 +22,7 @@ Example
2222
- The code can continue executing other tasks while waiting for the data to be retrieved.
2323
- Once the data is available, a callback function is called to process it.
2424

25-
Important Note
25+
Note
2626

2727
- Asynchronous programming can introduce complexities like callbacks, promises, or async/await. Careful handling is required to manage asynchronous code effectively.
2828

README.md

+48-42
Original file line numberDiff line numberDiff line change
@@ -126,59 +126,65 @@
126126
6. String Method
127127

128128
8. Array
129+
129130
1. Array Are Object
130131
2. Array Operation
131132
3. Array Destructure
132133
4. Array Iterate
133134
5. Array's method
134135
1. map()
135136

136-
- Objects
137-
- Object Iteration
138-
- Object Computed Properties
139-
- Object Destructure
140-
- Object Cloning
141-
- Optional Chaining
142-
143-
1. Object Oriented Programming
144-
145-
1. Object
146-
2. Constructor Function
147-
3. `new` keyword
148-
4. What Is Oops?
149-
5. Class
150-
6. Constructor
151-
7. Class Method
152-
8. Factory Function
153-
9. Inheritance
137+
9. Objects
138+
139+
1. Object Iteration
140+
2. Object Computed Properties
141+
3. Object Destructure
142+
4. Object Cloning
143+
5. Optional Chaining
144+
145+
10. Object Oriented Programming
146+
147+
1. Object
148+
2. Constructor Function
149+
3. `new` keyword
150+
4. What Is Oops?
151+
5. Class
152+
6. Constructor
153+
7. Class Method
154+
8. Factory Function
155+
9. Inheritance
154156
10. Encapsulation
155157
11. Abstraction
156158
12. Polymorphism
157159

158-
1. JavaScript Under the Hood
159-
160-
1. Compiler
161-
2. Interpreter
162-
3. Compile Time
163-
4. Runtime
164-
165-
1. JavaScript Execution Context
166-
167-
1. Context
168-
2. Execution Context
169-
1. Global Execution Context
170-
1. Memory Creation Phase
171-
2. Execution Phase
172-
2. Function Execution Context
173-
174-
1. Asynchronous JavaScript
175-
1. Asynchronous Operations
176-
2. setTimeout & setInterval
177-
3. Call back
178-
1. Call back function
179-
2. Call back hell
180-
4. Promise
181-
5. Fetch
160+
11. JavaScript Under the Hood
161+
162+
1. Compiler
163+
2. Interpreter
164+
3. Compile Time
165+
4. Runtime
166+
5. JavaScript Engine
167+
6. JavaScript Environment
168+
7. Just in time compilation (JIT)
169+
170+
12. JavaScript Execution Context
171+
172+
1. Context
173+
2. Execution Context
174+
1. Global Execution Context
175+
1. Memory Creation Phase
176+
2. Execution Phase
177+
2. Function Execution Context
178+
179+
13. Asynchronous JavaScript
180+
1. Asynchronous Operations
181+
2. setTimeout & setInterval
182+
3. Async and Await
183+
4. Call back
184+
1. Call back function
185+
2. Call back hell
186+
5. Promise
187+
6. Fetch
182188

183189
<!-- OOP -->
184190

code_test_space.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ function mySecond() {
3636
console.log("Goodbye");
3737
}
3838

39-
mySecond();
39+
mySecond();
4040
myFirst();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# JavaScript Engine
2+
3+
What
4+
5+
- A JavaScript engine is a software component that executes JavaScript code. It's the core part of a JavaScript runtime environment.
6+
7+
Why
8+
9+
- Interprets JavaScript: Translates human-readable JavaScript code into machine-understandable instructions.
10+
- Optimizes performance: Employs techniques like Just-In-Time (JIT) compilation to improve execution speed.
11+
- Manages memory: Handles memory allocation and garbage collection.
12+
13+
Example
14+
15+
- V8: Used in Google Chrome and Node.js.
16+
- SpiderMonkey: Used in Mozilla Firefox.
17+
- JavaScriptCore: Used in Safari.
18+
19+
Note
20+
21+
- Modern JavaScript engines often use a combination of interpretation and compilation for optimal performance. They also include features like garbage collection to manage memory efficiently.
22+
23+
Analogy
24+
25+
- Think of a JavaScript engine as a translator that converts English (JavaScript) into a language the computer understands (machine code).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# JavaScript Environment
2+
3+
What
4+
5+
- A JavaScript environment is the runtime context where JavaScript code executes. It provides the necessary tools and APIs for JavaScript to interact with the host environment (e.g., a web browser or server).
6+
7+
Why
8+
9+
- Provides APIs: Offers built-in functions and objects for interacting with the environment (e.g., DOM, network, file system).
10+
- Handles execution: Manages the call stack, heap, and event loop.
11+
- Creates a sandbox: Isolates JavaScript code from the underlying system for security.
12+
13+
How
14+
- JavaScript Engine: The core component that interprets or compiles JavaScript code.
15+
- Web APIs: Provide access to browser features (DOM, BOM) or server-side functionalities.
16+
- Event Loop: Handles asynchronous operations and events.
17+
- Call Stack: Manages function calls and returns.
18+
- Heap: Stores objects and data.
19+
20+
Example
21+
22+
- Browser Environment: Provides DOM (Document Object Model) for manipulating HTML elements and BOM (Browser Object Model) for interacting with the browser window.
23+
- Node.js Environment: Offers modules for file system access, network communication, and server-side tasks.
24+
25+
Note
26+
27+
- Different environments provide different APIs and capabilities. Understanding the specific environment is crucial for effective JavaScript development.
28+
29+
Analogy
30+
31+
- Think of a JavaScript environment as a stage where a play (your JavaScript code) is performed. The stage provides the setting, props, and audience (APIs and runtime), while the actors (your code) interact with the environment to create the performance.

0 commit comments

Comments
 (0)