Skip to content

Commit a6c09f0

Browse files
committed
minor formatting fixes
1 parent d2b91f8 commit a6c09f0

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

JavaScript-Quick-Reference.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,7 @@ fetchData((result) => {
10291029
Promises provide a structured way to handle asynchronous operations.
10301030
- **Note:** the P for Promise is capitalized, unlike other syntax.
10311031

1032+
10321033
```javascript
10331034
function fetchData() {
10341035
return new Promise((resolve, reject) => {
@@ -1047,6 +1048,7 @@ fetchData()
10471048
});
10481049
```
10491050

1051+
10501052
`Promise.all` Enables parallel execution of multiple Promises, waiting for all to complete.
10511053

10521054
```javascript
@@ -1069,7 +1071,7 @@ Promise.all([promise1, promise2, promise3])
10691071
## 7.1 Understanding APIs, JSON, and API Keys
10701072

10711073
### APIs at a Glance
1072-
APIs (Application Programming Interfaces) are like connectors, allowing your code to interact with external services and access their data and functions.
1074+
APIs (Application Programming Interfaces) connect your code to external services for data and functions.
10731075

10741076
### API Keys
10751077
For many APIs, you'll need an API key for authentication and usage tracking:
@@ -1079,7 +1081,7 @@ For many APIs, you'll need an API key for authentication and usage tracking:
10791081
3. **Usage Guidelines:** Check the provider's documentation for usage instructions, rate limits, and any costs.
10801082

10811083
### JSON Simplified
1082-
JSON (JavaScript Object Notation) is a straightforward, human-readable data format commonly used in APIs for data exchange. It's easy for both humans and machines.
1084+
JSON (JavaScript Object Notation) is a straightforward, human-readable data format commonly used in APIs for data exchange.
10831085

10841086
### Handling JSON
10851087
When working with JSON data, remember to:
@@ -1219,10 +1221,12 @@ const result2 = updatedJsonData; // Use 'result2' for further processing
12191221
Overview of Object-Oriented Programming (OOP) concepts in JavaScript.
12201222

12211223
### Object-Oriented Programming (OOP)
1222-
OOP is a programming paradigm that uses objects and classes to organize code. In JavaScript, objects are at the core of OOP.
1224+
OOP is a programming paradigm that uses objects and classes to organize code.
1225+
In JavaScript, objects are at the core of OOP.
12231226

12241227
### Objects
1225-
Objects are instances of classes or constructors and encapsulate data and behavior They consist of properties (data) and methods (functions).
1228+
Objects are instances of classes or constructors and encapsulate data and behavior.
1229+
They consist of properties (data) and methods (functions).
12261230

12271231
```javascript
12281232
// Creating an Object
@@ -1244,7 +1248,8 @@ person.sayHello(); // Output: "Hello, my name is John and I'm 30 years old."
12441248
```
12451249

12461250
### Classes
1247-
Classes are blueprints or templates for creating objects. They define the structure and behavior of objects.
1251+
Classes are blueprints or templates for creating objects.
1252+
They define the structure and behavior of objects.
12481253

12491254
```javascript
12501255
// Creating a Class
@@ -1271,7 +1276,8 @@ person2.sayHello(); // Output: "Hello, my name is Bob and I'm 35 years old."
12711276
```
12721277

12731278
### Constructor Method
1274-
The constructor method is called when an object is created from the class. It initializes object properties.
1279+
The constructor method is called when an object is created from the class.
1280+
It initializes object properties.
12751281

12761282
### Class Inheritance
12771283
Classes can inherit properties and methods from another class using the'extends' keyword.
@@ -1345,12 +1351,13 @@ const person = {
13451351
---
13461352

13471353
## 9.1 TIPS AND BEST PRACTICES
1354+
Tips for cleaner, more maintainable, and efficient JavaScript code.
13481355

13491356
### 1. Use Descriptive Variable and Function Names**
13501357
- Choose meaningful and descriptive names for variables and functions to improve code readability.
13511358
- Avoid overly abbreviated or cryptic names.
13521359

1353-
### Consistent Code Formatting
1360+
### 2. Consistent Code Formatting
13541361
- Follow a consistent code formatting style to enhance code maintainability.
13551362
- Consider using popular coding conventions like the Airbnb JavaScript Style Guide.
13561363

@@ -1386,9 +1393,6 @@ const person = {
13861393
- Follow industry best practices and consider performance optimizations.
13871394

13881395

1389-
These tips and best practices will help you write cleaner, more maintainable, and efficient JavaScript code.
1390-
1391-
13921396
### Further Learning Resources
13931397

13941398
- [MDN Web Docs (Mozilla Developer Network)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)

0 commit comments

Comments
 (0)