Skip to content

Commit 4e599aa

Browse files
authored
Merge pull request #4322 from CodeHarborHub/restyled/dev-3
Restyle Dev 3
2 parents 2f257a3 + f3b7efa commit 4e599aa

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

docs/CSS/_category_.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"label": "CSS",
3-
"position": 20,
4-
"link": {
5-
"type": "generated-index",
6-
"description": "In this section, you will learn about the CSS."
7-
}
8-
}
2+
"label": "CSS",
3+
"position": 20,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "In this section, you will learn about the CSS."
7+
}
8+
}

docs/javascript/all-about-variables/hoisting.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Function expressions are not hoisted in the same way as function declarations. O
9494
```javascript title="app.js"
9595
sayHello(); // Throws a TypeError
9696

97-
var sayHello = function() {
97+
var sayHello = function () {
9898
console.log("Hello, World!");
9999
};
100100
```
@@ -118,6 +118,7 @@ By understanding how hoisting works, you can avoid common pitfalls and write mor
118118
To avoid confusion and potential issues related to hoisting, it's a good practice to declare your variables and functions at the beginning of their containing scope. This makes your code more readable and predictable.
119119

120120
**Remember:**
121+
121122
- Use `let` and `const` for variable declarations to avoid hoisting-related bugs.
122123
- Declare functions before calling them to ensure they are hoisted correctly.
123124
- Be mindful of the TDZ when using `let` and `const` to prevent `ReferenceError` issues.
@@ -129,4 +130,4 @@ Hoisting can feel like magic, but understanding how it works will help you write
129130

130131
## Conclusion
131132

132-
Hoisting is a unique feature of JavaScript that allows you to access variables and functions before they are declared in your code. By hoisting declarations to the top of their containing scope, JavaScript enables you to write code that might seem out of order but still works as expected.
133+
Hoisting is a unique feature of JavaScript that allows you to access variables and functions before they are declared in your code. By hoisting declarations to the top of their containing scope, JavaScript enables you to write code that might seem out of order but still works as expected.

docs/javascript/all-about-variables/variable-naming-rules.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: Learn about the rules and best practices for naming variables in Ja
99

1010
<AdsComponent />
1111

12-
When writing JavaScript code, it's essential to follow consistent naming conventions for variables to improve code readability and maintainability. Variable names should be descriptive, meaningful, and follow certain rules to ensure clarity and avoid conflicts.
12+
When writing JavaScript code, it's essential to follow consistent naming conventions for variables to improve code readability and maintainability. Variable names should be descriptive, meaningful, and follow certain rules to ensure clarity and avoid conflicts.
1313

1414
In this tutorial, we'll cover the essential rules for naming variables in JavaScript, along with examples and tips to help you avoid common mistakes.
1515

@@ -44,11 +44,12 @@ By following the rules and best practices for naming variables, you can write be
4444

4545
When naming variables in JavaScript, you need to follow certain rules and conventions to ensure consistency and readability. Here are the essential rules for naming variables:
4646

47-
### 1. Variable Names Must Begin with a Letter, Underscore (_), or Dollar Sign ($)
47+
### 1. Variable Names Must Begin with a Letter, Underscore (\_), or Dollar Sign ($)
4848

4949
A variable name can start with any of these three characters:
50+
5051
- **Letter**: The first character of a variable name must be a letter (a-z, A-Z) or an uppercase or lowercase letter.
51-
- Underscore (_): You can use an underscore as the first character of a variable name. It is commonly used to indicate a private or internal variable.
52+
- Underscore (\_): You can use an underscore as the first character of a variable name. It is commonly used to indicate a private or internal variable.
5253
- Dollar Sign ($): While the dollar sign can be used in variable names, it is less common and not recommended due to its use in certain JavaScript libraries and frameworks.
5354

5455
**Example:**
@@ -58,12 +59,14 @@ let name = "Alice";
5859
let _count = 10;
5960
let $price = 25.99;
6061
```
62+
6163
### 2. Variable Names Can Contain Letters, Numbers, Underscores, and Dollar Signs
6264

6365
After the first character, variable names can include:
66+
6467
- Letters (a-z, A-Z)
6568
- Numbers (0-9)
66-
- Underscores (_)
69+
- Underscores (\_)
6770
- Dollar Signs ($)
6871

6972
**Examples:**
@@ -130,7 +133,7 @@ let coordinateX = 10;
130133

131134
// Acceptable in loops
132135
for (let i = 0; i < 10; i++) {
133-
console.log(i);
136+
console.log(i);
134137
}
135138
```
136139

@@ -216,4 +219,4 @@ By following these guidelines, you can create well-structured, readable, and mai
216219

217220
## Conclusion
218221

219-
In this tutorial, you learned about the rules and best practices for naming variables in JavaScript. By following these guidelines, you can write clean, consistent, and readable code that is easier to maintain and understand. Remember that choosing meaningful and descriptive variable names is essential for improving code quality, readability, and maintainability.
222+
In this tutorial, you learned about the rules and best practices for naming variables in JavaScript. By following these guidelines, you can write clean, consistent, and readable code that is easier to maintain and understand. Remember that choosing meaningful and descriptive variable names is essential for improving code quality, readability, and maintainability.

0 commit comments

Comments
 (0)