-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.js
53 lines (40 loc) · 1.92 KB
/
Index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Here are some best practices for naming conventions of functions, variables, and comments in JavaScript files:
* **Functions**
* Use PascalCase for function names.
* Use descriptive names that accurately reflect the purpose of the function.
* Avoid using abbreviations or acronyms.
* Avoid using special characters, such as spaces, underscores, or hyphens.
* **Variables**
* Use camelCase for variable names.
* Use descriptive names that accurately reflect the purpose of the variable.
* Avoid using abbreviations or acronyms.
* Avoid using special characters, such as spaces, underscores, or hyphens.
* **Comments**
* Use comments to explain what your code is doing.
* Use comments to document your code.
* Use comments to make your code easier to understand.
* Keep your comments concise and informative.
* Here are some examples of good function, variable, and comment names:
* **Functions**
* `addNumbers()`
* `getUserName()`
* `sortArray()`
* **Variables**
* `totalNumbers`
* `currentUser`
* `sortedArray`
* **Comments**
// This function adds two numbers together.
// This function gets the user's name from the database.
// This function sorts an array in ascending order.
* By following these best practices, you can help to create clear, informative, and easy-to-understand JavaScript code.
* Here are some additional tips for naming functions, variables, and comments:
* Use consistent capitalization and punctuation.
* Avoid using special characters, such as spaces, underscores, or hyphens.
* Avoid using acronyms or abbreviations.
* Avoid using personal names or nicknames.
* Use descriptive names that accurately reflect the purpose of the function, variable, or comment.
By following these tips, you can help to create a consistent and readable naming convention for your JavaScript code.
*/
// here is an example: https://api.github.com/users/adhilsalim