Skip to content

Commit ef69930

Browse files
committed
wording fixes and linking refrences
1 parent 2c3d21e commit ef69930

File tree

12 files changed

+52
-43
lines changed

12 files changed

+52
-43
lines changed

en/browser-object-model-bom/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ window.alert("Welcome to Learn JavaScript");
1818
alert("Welcome to Learn JavaScript")
1919
```
2020

21-
In a similar fashion, we can call other properties underneath the window object such as history, screen, navigator, location, and so on.
21+
In this chapter, we are going to talk about various properties and methods of browser object model.
22+
* [cookies](./cookies.md)
23+
* [history](./history.md)
24+
* [location](./location.md)
25+
* [navigator](./navigator.md)
26+
* [popup](./popup.md)
27+
* [screen](./screen.md)
28+
* [window](./window.md)
29+
30+
2231

2332

2433

en/date-and-time.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: The date object stores date and time and provides methods for manag
88
# Chapter 10
99
# Date and Time
1010

11-
The `date` object stores date and time and provides methods for managing it. Date objects are static and use a browser's default timezone to display the date as a full-text string.
11+
The `date` object stores date and time and provides methods for managing it. `Date` objects are static and use a browser's default timezone to display the date as a full-text string.
1212

1313
To create `date` we use a `new Date()` constructor and can be created in the following ways.
1414

en/es6-concepts/template-literals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const dynamicString = `This is a dynamic string with ${expression}`;
1616

1717
- `dynamicString`: This is where you store the dynamic string.
1818

19-
- `${expression}`: This is where you embed JavaScript expressions, variables, or functions, which are evaluated and included within the string.
19+
- `${expression}`: This is where you embed JavaScript expressions, [variables](../basics/variables.md), or [functions](../functions/README.md), which are evaluated and included within the string.
2020

2121
**Example:**
2222

en/miscellaneous/api-ajax.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ In this section, we will discuss API and AJAX, the two important technologies th
1111

1212
An **API** (Application Programming Interface) is a set of rules and protocols that allows different software applications to communicate with each other. It defines the methods and data formats that applications can use to request and exchange information.
1313

14-
## Key Points
14+
### Key Points
1515

1616
- APIs enable developers to access the functionality of other software components, services, or platforms without needing to understand their internal workings.
1717

@@ -25,7 +25,7 @@ An **API** (Application Programming Interface) is a set of rules and protocols t
2525

2626
- Examples of popular APIs include social media APIs (e.g., Facebook Graph API), payment gateway APIs (e.g., PayPal API), and cloud service APIs (e.g., AWS API).
2727

28-
## Benefits of APIs
28+
### Benefits of APIs
2929

3030
- **Interoperability:** APIs allow different software systems to work together, promoting compatibility and data exchange.
3131

@@ -37,15 +37,15 @@ An **API** (Application Programming Interface) is a set of rules and protocols t
3737

3838
- **Security:** APIs often include authentication and authorization mechanisms to ensure secure access to data and services.
3939

40-
# AJAX (Asynchronous JavaScript and XML)
40+
## AJAX (Asynchronous JavaScript and XML)
4141

4242
AJAX, short for **Asynchronous JavaScript and XML**, is a foundational technology in web development. It enables web applications to make asynchronous requests to a server, retrieve data, and update parts of a web page without requiring a full page reload. While the name suggests XML, AJAX can work with various data formats, with JSON being the most common.
4343

44-
## What is AJAX?
44+
### What is AJAX?
4545

4646
At its core, AJAX is a technique that allows web pages to communicate with a server in the background, without disrupting the user's interaction with the page. This asynchronous behavior is achieved using JavaScript and enables the development of more interactive and responsive web applications.
4747

48-
## How does AJAX work?
48+
### How does AJAX work?
4949

5050
1. **JavaScript**: AJAX heavily relies on JavaScript to initiate requests and handle responses asynchronously.
5151

@@ -59,7 +59,7 @@ At its core, AJAX is a technique that allows web pages to communicate with a ser
5959

6060
6. **Rendering**: The updated content is rendered on the web page without requiring a full page reload, resulting in a smoother user experience.
6161

62-
## Benefits of AJAX
62+
### Benefits of AJAX
6363

6464
- **Improved User Experience**: AJAX allows web applications to load and display data without the need for full page refreshes, making the user experience more seamless and interactive.
6565

@@ -69,7 +69,7 @@ At its core, AJAX is a technique that allows web pages to communicate with a ser
6969

7070
- **Dynamic Loading**: Content can be loaded on-demand, leading to faster initial page load times and more responsive applications.
7171

72-
## Common Use Cases
72+
### Common Use Cases
7373

7474
Some common scenarios where AJAX is used include:
7575

@@ -81,26 +81,26 @@ Some common scenarios where AJAX is used include:
8181

8282
- **Updating Content**: Dynamically updating content like news feeds, weather information, or sports scores without requiring manual page refreshes.
8383

84-
# Fetching Weather Data with OpenWeatherMap API using AJAX
84+
## Fetching Weather Data with OpenWeatherMap API using AJAX
8585

8686
In this example, we'll demonstrate how to use AJAX (Asynchronous JavaScript and XML) to fetch weather information from the OpenWeatherMap API and display it on a web page.
8787

88-
## Introduction
88+
### Introduction
8989

9090
The OpenWeatherMap API is a powerful tool for retrieving weather information for locations around the world. This example demonstrates how to use the API to fetch current weather data for a specific city and display it in your application or documentation.
9191

92-
## API Key
92+
### API Key
9393

9494
Before getting started, you need to sign up for an API key from [OpenWeatherMap](https://openweathermap.org/api) to access their weather data API. Replace `'YOUR_API_KEY'` in the code below with your actual API key.
9595

9696
```javascript
9797
const apiKey = 'YOUR_API_KEY';
9898
```
99-
# Simple Weather App HTML
99+
### Simple Weather App HTML
100100

101101
In this example, we'll provide the HTML structure for a simple weather app that fetches and displays weather data from the OpenWeatherMap API.
102102

103-
## HTML Structure
103+
#### HTML Structure
104104

105105
```html
106106
<!DOCTYPE html>
@@ -121,7 +121,7 @@ In this example, we'll provide the HTML structure for a simple weather app that
121121
</html>
122122
```
123123

124-
## JavaScript (script.js)
124+
#### JavaScript (script.js)
125125

126126
Create a JavaScript file named `script.js` to handle the AJAX request and update the weather data on the page:
127127

@@ -155,7 +155,7 @@ xhr.onload = function () {
155155

156156
xhr.send();
157157
```
158-
## Result
158+
### Result
159159

160160
When you open the HTML file in a web browser, it will display the weather information for the specified location (New York in this case). Make sure to replace `'YOUR_API_KEY'` with your actual OpenWeatherMap API key.
161161

en/miscellaneous/callback.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ description: A callback is a function passed as an argument to another function,
88

99
Callback functions are a fundamental concept in JavaScript, enabling asynchronous and event-driven programming. This Markdown document provides an in-depth explanation of callback functions, their purpose, and how to use them effectively.
1010

11-
## What is a Callback Function?
11+
### What is a Callback Function?
1212

1313
- A **callback function** is a JavaScript function that is passed as an argument to another function.
1414
- It is typically invoked or executed at a later time, often after some asynchronous operation or event.
1515
- Callbacks are essential for handling tasks like data retrieval, event handling, and dealing with asynchronous behavior.
1616

17-
## Why Use Callback Functions?
17+
### Why Use Callback Functions?
1818

1919
- **Asynchronous Operations**: Callbacks are crucial for managing asynchronous operations like file reading, API requests, and timers.
2020
- **Event Handling**: They are used to respond to events like button clicks, user input, or network responses.
2121
- **Modular Code**: Callbacks help write modular and reusable code by separating concerns and promoting the single-responsibility principle.
2222

23-
## Anatomy of a Callback Function
23+
### Anatomy of a Callback Function
2424

2525
A typical callback function has the following structure:
2626

@@ -36,29 +36,29 @@ function callbackFunction(arg1, arg2, ..., callback) {
3636
- **callbackFunction** is the function that takes a callback as an argument.It may perform some operations asynchronously.
3737
- It eventually calls the **callback** function, passing it a result or an error.
3838

39-
## Handling Errors in Callbacks
39+
### Handling Errors in Callbacks
4040

4141
In JavaScript, callback functions can handle errors by convention. It's common to pass an error object as the first argument or use the second argument to represent errors. Developers should check for errors and handle them appropriately within the callback function.
4242

43-
## Alternative Approaches to Callbacks
43+
### Alternative Approaches to Callbacks
4444

4545
1. **Promises**: Promises offer a structured way to handle asynchronous code and errors. They have three states: pending, fulfilled, and rejected. Promises use the `.then()` and `.catch()` methods to handle success and error scenarios.
4646

4747
2. **Async/Await**: Async/await is a more recent addition to JavaScript. It simplifies asynchronous code by allowing developers to write it in a more synchronous style. It's built on top of Promises and is especially useful for handling asynchronous operations with a more linear code flow.
4848

4949
3. **Event Emitters**: In Node.js, the `EventEmitter` class allows you to create custom event-driven architectures for handling asynchronous tasks.
5050

51-
# Callback Hell (Callback Pyramid) and Example
51+
## Callback Hell (Callback Pyramid)
5252

5353
Callback hell, also known as the "pyramid of doom," is a common issue in JavaScript when working with deeply nested callback functions. This phenomenon occurs when multiple asynchronous operations are chained one after the other, making the code difficult to read and maintain. This Markdown document explains callback hell and provides a simple example.
5454

55-
## What is Callback Hell?
55+
### What is Callback Hell?
5656

5757
- **Callback hell** occurs when asynchronous functions are nested within each other, leading to deeply indented code structures.
5858
- It makes code harder to understand, debug, and maintain due to excessive indentation levels.
5959
- Callback hell often results from handling multiple asynchronous operations sequentially, such as making API requests or reading/writing files.
6060

61-
## Example of Callback Hell
61+
#### Example
6262

6363
```javascript
6464
asyncOperation1(function (result1) {
@@ -78,29 +78,29 @@ asyncOperation1(function (result1) {
7878
});
7979
});
8080
```
81-
## Problems with Callback Hell
81+
### Problems with Callback Hell
8282

8383
- **Readability**: Callback hell leads to deeply indented code, making it challenging to read and understand. This can hinder code reviews and collaboration.
8484

8585
- **Maintainability**: As more asynchronous operations are added, callback hell makes the codebase difficult to maintain. Modifying existing functionality or adding new features becomes error-prone.
8686

8787
- **Error Handling**: Managing errors becomes complex in nested callbacks. Handling exceptions and propagating errors to higher levels can be challenging.
8888

89-
## Mitigating Callback Hell
89+
### Mitigating Callback Hell
9090

91-
### 1. Named Functions
91+
#### 1. Named Functions
9292

9393
- Break down callback functions into separate, named functions. This improves code readability by giving meaningful names to individual functions.
9494

95-
### 2. Promises
95+
#### 2. Promises
9696

9797
- Promises provide a more structured way to handle asynchronous code. They allow you to chain asynchronous operations, making the code more linear and easier to read.
9898

99-
### 3. Async/Await
99+
#### 3. Async/Await
100100

101101
- Async/await is a more recent addition to JavaScript. It simplifies asynchronous code by allowing you to write it in a more synchronous style. It is built on top of Promises and is especially useful for handling asynchronous operations with a more linear code flow.
102102

103-
### 4. Modularization
103+
#### 4. Modularization
104104

105105
- Organize code into smaller, reusable modules. This reduces the complexity of individual functions and makes it easier to manage asynchronous operations.
106106

en/miscellaneous/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: In programming, errors can occur while writing code. It could be du
55
---
66
# Debugging
77

8-
In programming, errors can occur while writing code. It could be due to syntactical or logical errors. The process of finding errors can be time-consuming and tricky and is called *code debugging*.
8+
In programming, errors can occur while writing code. It could be due to syntactical or logical errors. The process of finding errors can be time-consuming and tricky and is called **code debugging**.
99

1010
Fortunately, most modern browsers come with built-in debuggers. These debuggers can be switched on and off, forcing errors to be reported. It is also possible to set up breakpoints during the execution of code to stop execution and examine variables. For this one has to open a debugging window and place the `debugger` keyword in the JavaScript code. The code execution is stopped in each breakpoint, allowing developers to examine the JavaScript values and, resume the execution of code.
1111

en/miscellaneous/hoisting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Hosting is a default behavior in JavaScript of moving declarations
55
---
66
# Hoisting
77

8-
Hosting is a default behavior in JavaScript of moving declarations at the top. While executing a code, it creates a global execution context: creation and execution. In the creation phase, JavaScript moves the variable and function declaration to the top of the page, which is known as hoisting.&#x20;
8+
Hosting is a default behavior in JavaScript of moving declarations at the top. While executing a code, it creates a global execution context: **creation** and **execution**. In the creation phase, JavaScript moves the variable and function declaration to the top of the page, which is known as hoisting.&#x20;
99

1010
```javascript
1111
// variable hoisting

en/miscellaneous/linked-list.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ There are three different types of linked lists:
2121
2. **Doubly Linked Lists:** There are two pointers at each node, one to the next node and one to the previous node.
2222
3. **Circular Linked Lists:** A circular linked list forms a loop by having the last node pointing to the first node or any other node before it.
2323

24-
# Add
24+
## Add
2525

2626
The `add` method is created here to add value to a linked list.
2727

@@ -52,7 +52,7 @@ class LinkedList {
5252
}
5353
```
5454

55-
# Pop
55+
## Pop
5656

5757
Here, a `pop` method is created to remove a value from the linked list.
5858

@@ -78,7 +78,7 @@ class LinkedList {
7878
}
7979
```
8080

81-
# Prepend
81+
## Prepend
8282

8383
Here, a `prepend` method is created to add a value before the first child of the linked list.
8484

@@ -107,7 +107,7 @@ class LinkedList {
107107
}
108108
```
109109

110-
# Shift
110+
## Shift
111111

112112
Here, the `shift` method is created to remove the first element of the Linked List.
113113

en/miscellaneous/single-thread-nature.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Here are some key points to understand about JavaScript's single-threaded execut
2424

2525
6. **Browser and Environment Interaction:** In web development, JavaScript interacts with the browser's Document Object Model (DOM) and other browser APIs. To maintain a responsive user interface, JavaScript code must execute quickly and efficiently and delegate time-consuming operations to separate threads when necessary.
2626

27-
## Single-Threaded Asynchronous Example
27+
## Example
2828

2929
```javascript
3030
// Simulating an asynchronous operation with a callback

en/modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _Modules_ come to avoid these problems. A `module` specifies which pieces of cod
1414

1515
* **AMD** - one of the oldest module systems, initially used by [require.js](https://requirejs.org/).
1616
* **CommonJS** - module system created for Node.js server.
17-
* **UMD** - module system that is compatible with AMD and CommonJS.
17+
* **UMD** - module system that is compatible with [AMD](https://requirejs.org/docs/whyamd.html#amd) and [CommonJS](https://requirejs.org/docs/whyamd.html#commonjs).
1818

1919
Modules can load each other, and use special directives `import` and `export` to interchange functionality, and call functions of each other.
2020

0 commit comments

Comments
 (0)