Skip to content

Commit 03f9f15

Browse files
committed
typo fixes
1 parent 577f871 commit 03f9f15

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
22
chapter: 24
33
---
4-
# Filesystem
4+
# File system
55
Filesystem operations in JavaScript are used to interact with the file system of the host environment, which can be a web browser (client-side JavaScript) or a server (Node.js). JavaScript provides various APIs and methods for reading from and writing to the file system. These operations are essential for tasks like saving data, reading configuration files, and processing user-uploaded files. Below is an overview of filesystem operations in JavaScript:
66
#### Asynchronous and Non-Blocking I/O:
77

88
In Node.js, I/O operations can be performed asynchronously, meaning that they don't block the execution of the program. Instead, they are placed in a queue, and the program continues executing other tasks. When the I/O operation is completed, a callback function is called to handle the result. This is particularly useful for I/O operations that may take a significant amount of time.
99

10-
##### Read:
10+
#### Read:
1111
In this example, you are using the fs.readFile function to read data from the 'test.txt' file asynchronously. It takes a callback function that gets executed when the read operation is finished. The console.log("This gets printed at First") line is executed immediately after initiating the read operation, and it doesn't wait for the reading to complete.
1212

1313
```javascript
1414
const fs= require('fs');
1515
//async
1616
//non blokcing i/0 thats why runs at last as ti takes moer time
17-
fs.readFile('test.txt','utf8',(err,data)=>{
17+
fs.readFile('test.txt','utf8',(err,data) => {
1818
console.log(err,data)
1919
})
2020
console.log("This gets printed at First")
@@ -24,8 +24,7 @@ console.log("This gets printed at First")
2424
Here, you use fs.writeFile to write data to the 'test.txt' file asynchronously. The callback function is executed when the write operation is finished. It prints "This runs after writing in a file: written to file" after the write operation is complete.
2525

2626
```javascript
27-
fs.writeFile("test.txt","mahima is good girl",()=>{
28-
27+
fs.writeFile("test.txt","mahima is good girl", () => {
2928
console.log("This runs after writting in a file: written to file")
3029
})
3130
```
@@ -49,7 +48,7 @@ fs.writeFileSync is used for synchronous file writing. It blocks the program's e
4948

5049

5150
```javascript
52-
fs.writeFileSync("test.txt","mahima is good girl",()=>{
51+
fs.writeFileSync("test.txt","mahima is good girl",() => {
5352
console.log("This is sync: intentionally process is blocked ")
5453
})
5554

en/resources.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
pageNumber: V
33
chapter:
44
---
5-
# List of Learning Resources
5+
# Learning Resources
66
## Articles for learning JavaScript
77

8-
Here are some beginner-friendly articles to learn JavaScript -
98

109
1. Introduction to JavaScript by Hostinger [Link](https://www.hostinger.com/tutorials/what-is-javascript)
1110

0 commit comments

Comments
 (0)