Skip to content

Commit 203a45a

Browse files
authored
Merge pull request #4343 from CodeHarborHub/dev-3
article ads added
2 parents 11e6761 + d352965 commit 203a45a

File tree

11 files changed

+118
-0
lines changed

11 files changed

+118
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: Learn about hoisting in JavaScript and how it affects variable decl
99

1010
<AdsComponent />
1111

12+
<br />
13+
1214
Hoisting is a unique feature of JavaScript that allows you to access variables and functions before they are declared in your code. This behavior can be surprising if you're not familiar with it, so understanding how hoisting works is essential for writing reliable JavaScript code.
1315

1416
In this tutorial, we'll explore what hoisting is, how it works in JavaScript, and how it affects variable declarations and function definitions.
@@ -19,6 +21,10 @@ Hoisting is a JavaScript mechanism where variable and function declarations are
1921

2022
It's important to note that only the declarations are hoisted, not the initializations. This means that the variable or function is available for use, but its value is `undefined` until the assignment is encountered in the code.
2123

24+
<AdsComponent />
25+
26+
<br />
27+
2228
## How Does Hoisting Work?
2329

2430
### Hoisting with Variables
@@ -101,6 +107,10 @@ var sayHello = function () {
101107

102108
In this example, the variable `sayHello` is hoisted to the top of the scope, but the function assignment is not. Trying to call `sayHello` before the function assignment results in a `TypeError`.
103109

110+
<AdsComponent />
111+
112+
<br />
113+
104114
### Summary of Hoisting Behavior
105115

106116
Here's a summary of how hoisting works in JavaScript:

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: Learn how to declare variables in JavaScript using the var, let, an
99

1010
<AdsComponent />
1111

12+
<br />
13+
1214
Variables are an essential part of any programming language, allowing you to store and manipulate data in your code. In JavaScript, variables are declared using the `var`, `let`, or `const` keywords. Each of these keywords has its own characteristics and best practices for usage. In this tutorial, we'll explore how to declare variables in JavaScript and discuss the differences between `var`, `let`, and `const`.
1315

1416
## What Are Variables?
@@ -43,6 +45,10 @@ In this example:
4345

4446
Now that you understand the concept of variables, let's explore how to declare them using the `var`, `let`, and `const` keywords.
4547

48+
<AdsComponent />
49+
50+
<br />
51+
4652
## Declaring Variables with `var`, `let`, and `const`
4753

4854
In JavaScript, you can declare variables using the `var`, `let`, or `const` keywords. Each keyword has its own scope, hoisting behavior, and mutability characteristics. Let's examine the differences between `var`, `let`, and `const` and when to use each one.
@@ -151,6 +157,10 @@ PI = 3.14; // Error: Assignment to constant variable.
151157

152158
- **Imagination:** Imagine `const` as a stone tablet with an inscription that cannot be changed once it's been carved. It's a constant reminder of the value it holds.
153159

160+
<AdsComponent />
161+
162+
<br />
163+
154164
## When to Use `var`, `let`, or `const`?
155165

156166
Here are some guidelines on when to use `var`, `let`, or `const` in your JavaScript code:

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

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

1010
<AdsComponent />
1111

12+
<br />
13+
1214
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.
1315

1416
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.
@@ -40,6 +42,10 @@ Choosing meaningful and descriptive variable names is crucial for writing clean
4042

4143
By following the rules and best practices for naming variables, you can write better code that is easier to maintain, understand, and share with others.
4244

45+
<AdsComponent />
46+
47+
<br />
48+
4349
## Rules for Naming Variables
4450

4551
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:
@@ -78,6 +84,10 @@ let _count = 42;
7884
let $discountRate = 0.1;
7985
```
8086

87+
<AdsComponent />
88+
89+
<br />
90+
8191
### 3. Variable Names Are Case-Sensitive
8292

8393
JavaScript variable names are case-sensitive, meaning that `name`, `Name`, and `NAME` are considered different variables. It's essential to be consistent with the casing of variable names to avoid confusion and errors in your code.
@@ -137,6 +147,10 @@ for (let i = 0; i < 10; i++) {
137147
}
138148
```
139149

150+
<AdsComponent />
151+
152+
<br />
153+
140154
### 7. Use CamelCase for Multi-Word Variable Names
141155

142156
When a variable name consists of multiple words, it's common to use CamelCase to improve readability. In CamelCase, the first word is lowercase, and subsequent words are capitalized. This convention makes variable names easier to read and understand.
@@ -203,6 +217,10 @@ let g_userName = "Alice";
203217

204218
By following these rules and best practices for naming variables in JavaScript, you can write clean, readable, and maintainable code that is easy to understand and work with.
205219

220+
<AdsComponent />
221+
222+
<br />
223+
206224
## Summary
207225

208226
Naming variables is a fundamental aspect of writing clean and maintainable JavaScript code. By following the rules and best practices outlined in this tutorial, you can improve the readability, consistency, and quality of your codebase. Here's a quick summary of the key points covered:

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: Learn about the different scopes of variables in JavaScript.
99

1010
<AdsComponent />
1111

12+
<br />
13+
1214
Understanding variable scope in JavaScript is essential for writing effective and bug-free code. The scope of a variable determines where in your code a particular variable can be accessed or modified. Knowing how scopes work will help you prevent errors and make your code more predictable and maintainable.
1315

1416
In this tutorial, we'll explore the different types of scopes in JavaScript, how they work, and how you can use them to control the accessibility of your variables.
@@ -93,6 +95,10 @@ In the example above, `blockVar` is declared inside an `if` block, making it a b
9395

9496
Block scope helps you control the visibility and lifetime of variables within specific code blocks, reducing the chances of unintended side effects and making your code more predictable.
9597

98+
<AdsComponent />
99+
100+
<br />
101+
96102
## Shadowing and Variable Scope
97103

98104
Shadowing occurs when a variable declared in an inner scope has the same name as a variable in an outer scope. In such cases, the inner variable "shadows" the outer variable, making the outer variable inaccessible within the inner scope.

docs/javascript/data-types/primitive-types/number.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: Learn about the number data type in JavaScript, how to create numbe
99

1010
<AdsComponent />
1111

12+
<br />
13+
1214
Numbers are a crucial part of any programming language, and JavaScript is no exception. In JavaScript, numbers are used to perform calculations, manipulate data, and handle various operations. This tutorial will walk you through everything you need to know about numbers in JavaScript, from basic concepts to advanced usage.
1315

1416
## What Is a Number in JavaScript?
@@ -81,6 +83,10 @@ console.log(smallNumber); // Outputs: 0.000005
8183

8284
In the examples above, `5e6` represents `5` multiplied by `10` raised to the power of `6` (i.e., `5,000,000`), and `5e-6` represents `5` multiplied by `10` raised to the power of `-6` (i.e., `0.000005`).
8385

86+
<AdsComponent />
87+
88+
<br />
89+
8490
## Number Precision
8591

8692
JavaScript numbers are precise up to 15 digits. Beyond this, precision may be lost, and the results of calculations might not be what you expect.
@@ -124,6 +130,10 @@ console.log(negativeInfinity); // Output: -Infinity
124130
console.log(negativeInfinity - 1); // Output: -Infinity
125131
```
126132

133+
<AdsComponent />
134+
135+
<br />
136+
127137
### 3. NaN (Not-a-Number)
128138

129139
The `NaN` value represents a special "not-a-number" value in JavaScript. It is used to denote the result of an invalid mathematical operation, such as dividing zero by zero.
@@ -180,6 +190,10 @@ let number = parseInt("42");
180190
console.log(number); // Output: 42
181191
```
182192

193+
<AdsComponent />
194+
195+
<br />
196+
183197
### 4. `parseFloat()`
184198

185199
The `parseFloat()` function parses a string and returns a floating-point number.
@@ -238,6 +252,10 @@ console.log(isFinite(42)); // Outputs: true
238252
console.log(isFinite(Infinity)); // Outputs: false
239253
```
240254

255+
<AdsComponent />
256+
257+
<br />
258+
241259
### 9. `Number()`
242260

243261
The `Number()` function converts a value to a number.
@@ -297,6 +315,10 @@ let product = num1 * num2;
297315
console.log(product); // Output: 30
298316
```
299317

318+
<AdsComponent />
319+
320+
<br />
321+
300322
### 4. Division (`/`)
301323

302324
The division operator (`/`) is used to divide one number by another.

docs/javascript/data-types/primitive-types/string.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: Learn about the string data type in JavaScript, how to create strin
99

1010
<AdsComponent />
1111

12+
<br />
13+
1214
In JavaScript, a string is a sequence of characters enclosed within single or double quotes. Strings are used to represent text data and are one of the primitive data types in JavaScript.
1315

1416
## Creating Strings
@@ -51,6 +53,10 @@ let backticks = `Hello, World!`;
5153
console.log(backticks); // Output: Hello, World!
5254
```
5355

56+
<AdsComponent />
57+
58+
<br />
59+
5460
## Common String Operations
5561

5662
Strings in JavaScript support various operations, such as concatenation, interpolation, and methods for manipulating string data. Here are some common string operations:

docs/javascript/data-types/primitive-types/undefined.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: Learn about the undefined data type in JavaScript, how to create un
99

1010
<AdsComponent />
1111

12+
<br />
13+
1214
In JavaScript, `undefined` is a primitive data type that represents an undefined value. When a variable is declared but not assigned a value, it is automatically assigned the value `undefined`.
1315

1416
## Creating Undefined Values
@@ -44,6 +46,10 @@ let undefinedValue;
4446
console.log(typeof undefinedValue === "undefined"); // Output: true
4547
```
4648

49+
<AdsComponent />
50+
51+
<br />
52+
4753
## Common Operations with Undefined Values
4854

4955
### Assigning Undefined Values

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: JavaScript has a rich history that dates back to the early days of
99

1010
<AdsComponent />
1111

12+
<br />
13+
1214
JavaScript, the language that powers the dynamic behavior of websites today, has an interesting history that dates back to the early days of the internet. It was created in just **10 days**, but its impact on the web has been profound and long-lasting. JavaScript has evolved significantly over the years, growing from a simple scripting language to a versatile and powerful programming language that is used by millions of developers worldwide. JavaScript was initially developed by **Brendan Eich** in 1995 while he was working at Netscape Communications Corporation.
1315

1416
### The Birth of JavaScript: A 10-Day Wonder
@@ -35,6 +37,10 @@ When JavaScript was first released, it was met with skepticism by some developer
3537
- **2020:** JavaScript remains one of the most popular programming languages in the world, powering the majority of websites and web applications on the internet.
3638
- **Future:** JavaScript continues to evolve, with new frameworks, libraries, and tools being developed to enhance its capabilities and simplify web development.
3739

40+
<AdsComponent />
41+
42+
<br />
43+
3844
### JavaScript Today: A Ubiquitous Language
3945

4046
Today, JavaScript is used by millions of developers worldwide to build a wide range of applications, from simple websites to complex web applications. It has become an essential tool for front-end web development, enabling developers to create interactive, engaging user experiences. JavaScript is also used on the server-side, thanks to technologies like Node.js, allowing developers to build full-stack applications using a single language.

docs/javascript/introduction-to-javascript/how-to-run-javascript.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: Learn how to run JavaScript code in the browser and in Node.js.
99

1010
<AdsComponent />
1111

12+
<br />
13+
1214
JavaScript is a versatile language that can be run in various environments. Whether you're creating interactive web pages, building server-side applications, or scripting automation tasks, JavaScript has you covered. In this chapter, we'll explore different ways to run JavaScript, from your browser to the server and beyond.
1315

1416
## 1. Running JavaScript in the Browser
@@ -177,6 +179,10 @@ These online editors provide a convenient way to write and run JavaScript code w
177179
When using online editors, remember that your code runs in a sandboxed environment, so you may encounter limitations compared to running JavaScript locally on your machine.
178180
:::
179181

182+
<AdsComponent />
183+
184+
<br />
185+
180186
## 4. Running JavaScript in Integrated Development Environments (IDEs)
181187

182188
For more advanced JavaScript development, you can use Integrated Development Environments (IDEs) that provide powerful tools, debugging capabilities, and project management features. IDEs offer a comprehensive environment for writing, testing, and deploying JavaScript applications.

docs/javascript/introduction-to-javascript/javascript-versions.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ description: JavaScript has gone through numerous updates and improvements since
2323

2424
<AdsComponent />
2525

26+
<br />
27+
2628
JavaScript has gone through numerous updates and improvements since its inception in 1995. These updates are officially known as ECMAScript (ES) versions, named after the standard maintained by ECMA International. Understanding these versions and their features is crucial for anyone looking to master JavaScript. Let's explore each significant version of JavaScript, what they introduced, and how they transformed the language.
2729

2830
### ECMAScript 1 (ES1) - The Beginning (1997)
@@ -44,6 +46,10 @@ The first official version of JavaScript was standardized as **ECMAScript 1 (ES1
4446

4547
ES3 was a significant milestone in JavaScript’s evolution, laying the foundation for modern web development practices. Many of the features introduced in ES3 are still widely used today.
4648

49+
<AdsComponent />
50+
51+
<br />
52+
4753
### ECMAScript 4 (ES4) - The Unreleased Visionary
4854

4955
**ECMAScript 4 (ES4)** was an ambitious update that aimed to introduce many advanced features, including classes, modules, and strong typing. However, due to disagreements within the committee and concerns over the complexity of the proposed changes, ES4 was never officially released. Many of its ideas would later influence future versions of JavaScript.
@@ -141,6 +147,10 @@ ES5 was a significant step forward, making JavaScript more reliable, maintainabl
141147

142148
ES6 was a game changer, introducing many features that are now considered essential in modern JavaScript development.
143149

150+
<AdsComponent />
151+
152+
<br />
153+
144154
### ECMAScript 2016 (ES7) - Simplicity and Power
145155

146156
**ECMAScript 2016 (ES7)**, released in 2016, was a smaller update but still added some valuable features:
@@ -243,6 +253,10 @@ ES8 continued the trend of making JavaScript more powerful and expressive, with
243253

244254
ES9 further refined JavaScript’s capabilities, making it easier to work with complex data structures and asynchronous operations.
245255

256+
<AdsComponent />
257+
258+
<br />
259+
246260
### ECMAScript 2019 (ES10) - Refinements and Improvements
247261

248262
**ECMAScript 2019 (ES10)**, released in 2019, added useful refinements to JavaScript:
@@ -361,6 +375,10 @@ ES11 introduced features that improved code readability, maintainability, and pe
361375
362376
ES12 focused on quality-of-life improvements and developer productivity, making JavaScript code more concise and readable.
363377
378+
<AdsComponent />
379+
380+
<br />
381+
364382
### ECMAScript 2022 (ES13) - Even More Enhancements
365383
366384
**ECMAScript 2022 (ES13**), released in 2022, continued the trend of enhancing JavaScript with new features that improve code readability, performance, and ease of use. The additions in ES13 are subtle but impactful, particularly for developers working with large, complex applications.
@@ -495,6 +513,10 @@ ES12 focused on quality-of-life improvements and developer productivity, making
495513
496514
This feature enhances regular expression handling by providing more detailed information about matched substrings.
497515
516+
<AdsComponent />
517+
518+
<br />
519+
498520
### Conclusion
499521
500522
JavaScript has come a long way since its inception in 1995. Each new version of the language has introduced innovative features and improvements that have transformed the way developers write code. Understanding the evolution of JavaScript and the features introduced in each version is essential for mastering the language and staying up-to-date with the latest trends in web development. By learning about the different ECMAScript versions and their capabilities, you can enhance your skills as a JavaScript developer and build more robust, efficient, and maintainable applications.

0 commit comments

Comments
 (0)