Skip to content

Commit 4f44852

Browse files
authored
Merge pull request #4313 from CodeHarborHub/restyled/dev-3
Restyle Dev 3
2 parents 77776a5 + c41a8d9 commit 4f44852

File tree

7 files changed

+344
-324
lines changed

7 files changed

+344
-324
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"label": "All About Variables",
3-
"position": 2,
4-
"link": {
5-
"type": "generated-index",
6-
"description": "In this tutorial, you'll learn what is a variable, how to declare a variable, how to assign a value to a variable, and how to use variables in JavaScript."
7-
}
8-
}
2+
"label": "All About Variables",
3+
"position": 2,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "In this tutorial, you'll learn what is a variable, how to declare a variable, how to assign a value to a variable, and how to use variables in JavaScript."
7+
}
8+
}

docs/javascript/all-about-variables/variable-declarations.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Think of variables as containers that hold data. Just like a box where you can s
2222
**Example:**
2323

2424
Imagine you're working on a to-do list app. You might need to store the user's name, the tasks they want to complete, and the status of each task. Variables allow you to store these pieces of information:
25-
25+
2626
```javascript title="app.js"
2727
// Declare variables to store user information
2828
let userName = "Ajay";
2929

3030
// Declare variables to store tasks
3131
let task = "Complete JavaScript tutorial";
3232

33-
// Declare variables to store task status
33+
// Declare variables to store task status
3434
let isTaskCompleted = false;
3535
```
3636

@@ -110,8 +110,8 @@ console.log(count); // Outputs: 0
110110

111111
```javascript title="app.js"
112112
if (true) {
113-
let x = 10;
114-
console.log(x); // Outputs: 10
113+
let x = 10;
114+
console.log(x); // Outputs: 10
115115
}
116116

117117
console.log(x); // Error: x is not defined
@@ -166,15 +166,14 @@ By understanding the differences between `var`, `let`, and `const`, you can choo
166166

167167
Here's a quick comparison of the key characteristics of `var`, `let`, and `const`:
168168

169-
|No. | Feature | `var` | `let` | `const` |
170-
|:--- |:----------------|:-----------------------|:-----------------------|:-----------------------|
171-
|1. | Scope | Function-level | Block-level | Block-level |
172-
|2. | Hoisting | Yes | No | No |
173-
|3. | Re-declaration | Allowed | Not allowed | Not allowed |
174-
|4. | Reassignment | Allowed | Allowed | Not allowed |
175-
|5. | Initialization | Optional | Optional | Required |
176-
169+
| No. | Feature | `var` | `let` | `const` |
170+
| :-- | :------------- | :------------- | :---------- | :---------- |
171+
| 1. | Scope | Function-level | Block-level | Block-level |
172+
| 2. | Hoisting | Yes | No | No |
173+
| 3. | Re-declaration | Allowed | Not allowed | Not allowed |
174+
| 4. | Reassignment | Allowed | Allowed | Not allowed |
175+
| 5. | Initialization | Optional | Optional | Required |
177176

178177
## Conclusion
179178

180-
In this tutorial, you learned how to declare variables in JavaScript using the `var`, `let`, and `const` keywords. Each keyword has its own scope, hoisting behavior, and mutability characteristics. By understanding the differences between `var`, `let`, and `const`, you can choose the appropriate keyword based on the requirements of your variables.
179+
In this tutorial, you learned how to declare variables in JavaScript using the `var`, `let`, and `const` keywords. Each keyword has its own scope, hoisting behavior, and mutability characteristics. By understanding the differences between `var`, `let`, and `const`, you can choose the appropriate keyword based on the requirements of your variables.

docs/javascript/introduction-to-javascript/history-of-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ JavaScript's rich history, rapid evolution, and widespread adoption make it a la
4747

4848
### Conclusion
4949

50-
JavaScript has come a long way since its humble beginnings in 1995. From a simple scripting language to a versatile and powerful programming language, JavaScript has transformed the way we interact with the web. Its rich history, rapid evolution, and widespread adoption make it one of the most popular programming languages in the world today. Whether you're a front-end developer, a full-stack developer, or just getting started with web development, JavaScript offers a world of possibilities for building dynamic, interactive web applications that engage users and deliver rich, immersive experiences. As the web continues to evolve, JavaScript will continue to play a central role in shaping the future of web development, driving innovation and enabling developers to create cutting-edge applications that push the boundaries of what is possible on the web.
50+
JavaScript has come a long way since its humble beginnings in 1995. From a simple scripting language to a versatile and powerful programming language, JavaScript has transformed the way we interact with the web. Its rich history, rapid evolution, and widespread adoption make it one of the most popular programming languages in the world today. Whether you're a front-end developer, a full-stack developer, or just getting started with web development, JavaScript offers a world of possibilities for building dynamic, interactive web applications that engage users and deliver rich, immersive experiences. As the web continues to evolve, JavaScript will continue to play a central role in shaping the future of web development, driving innovation and enabling developers to create cutting-edge applications that push the boundaries of what is possible on the web.

0 commit comments

Comments
 (0)