@@ -13,10 +13,10 @@ make sure that you **read the whole guidelines**. If you have any doubt on the c
13
13
We are very happy that you consider implementing algorithms and data structures for others! This repository is
14
14
referenced and used by learners from around the globe. Being one of our contributors, you agree and confirm that:
15
15
16
- * You did your work - plagiarism is not allowed.
17
- * Any plagiarized work will not be merged.
18
- * Your work will be distributed under [ GNU License] ( LICENSE ) once your pull request is merged.
19
- * Your submitted work must fulfill our styles and standards.
16
+ - You did your work - plagiarism is not allowed.
17
+ - Any plagiarized work will not be merged.
18
+ - Your work will be distributed under [ GNU License] ( LICENSE ) once your pull request is merged.
19
+ - Your submitted work must fulfill our styles and standards.
20
20
21
21
** New implementation** is welcome! For example, new solutions to a problem, different representations of a graph data
22
22
structure or algorithm designs with different complexity.
@@ -35,19 +35,19 @@ If you submit a pull request that resolves an open issue, please help us to keep
35
35
36
36
An Algorithm is one or more functions (or classes) that:
37
37
38
- * take one or more inputs,
39
- * perform some internal calculations or data manipulations,
40
- * return one or more outputs,
41
- * have minimal side effects.
38
+ - take one or more inputs.
39
+ - perform some internal calculations or data manipulations.
40
+ - return one or more outputs.
41
+ - have minimal side effects.
42
42
43
43
Algorithms should be packaged in a way that would make it easy for readers to put them into larger programs.
44
44
45
45
Algorithms should:
46
46
47
- * have intuitive class and function names that make their purpose clear to readers
48
- * use JavaScript naming conventions and intuitive variable names to ease comprehension
49
- * be flexible to take different input values
50
- * raise JavaScript exceptions (RangeError, etc.) on erroneous input values
47
+ - have intuitive class and function names that make their purpose clear to readers.
48
+ - use JavaScript naming conventions and intuitive variable names to ease comprehension.
49
+ - be flexible to take different input values.
50
+ - raise JavaScript exceptions (RangeError, etc.) on erroneous input values.
51
51
52
52
Algorithms in this repo should not be how-to examples for existing JavaScript packages. Instead, they should perform
53
53
internal calculations or manipulations to convert input values into different output values. Those calculations or
@@ -56,9 +56,9 @@ should add unique value.
56
56
57
57
#### File Naming Convention
58
58
59
- * filenames should use the UpperCamelCase (PascalCase) style.
60
- * There should be no spaces in filenames.
61
- * ** Example:** ` UserProfile.js ` is allowed but ` userprofile.js ` ,` Userprofile.js ` ,` user-Profile.js ` ,` userProfile.js ` are
59
+ - filenames should use the UpperCamelCase (PascalCase) style.
60
+ - There should be no spaces in filenames.
61
+ - ** Example:** ` UserProfile.js ` is allowed but ` userprofile.js ` ,` Userprofile.js ` ,` user-Profile.js ` ,` userProfile.js ` are
62
62
not.
63
63
64
64
#### Module System
@@ -114,32 +114,35 @@ Before committing, please run
114
114
npm run style
115
115
```
116
116
117
- in order to apply the coding style (where it can be done automatically). If an error is shown, please figure out what's
117
+ In order to apply the coding style (where it can be done automatically). If an error is shown, please figure out what's
118
118
wrong, fix it and run standard again.
119
119
120
120
A few (but not all) of the things to keep in mind:
121
121
122
- * Use camelCase with the leading character as lowercase for identifier names (variables and functions)
123
- * Names start with a letter
124
- * Follow code indentation: Always use 2 spaces for indentation of code blocks
122
+ - Use camelCase with the leading character as lowercase for identifier names (variables and functions).
123
+ - Names start with a letter.
124
+ - Follow code indentation: Always use 2 spaces for indentation of code blocks.
125
+
125
126
``` js
126
- function sumOfArray (arrayOfNumbers ) {
127
+ function sumOfArray (arrayOfNumbers ) {
127
128
let sum = 0
129
+
128
130
for (let i = 0 ; i < arrayOfNumbers .length ; i++ ) {
129
131
sum += arrayOfNumbers[i]
130
132
}
131
- return (sum)
133
+
134
+ return sum
132
135
}
133
136
```
134
- *
135
- * Avoid using global variables and avoid ` == `
136
- * Please use ` let ` over ` var `
137
- * Please refrain from using ` console.log ` or any other console methods
138
- * ** Absolutely** don't use ` alert `
139
- * We strongly recommend the use of ECMAScript 6
140
- * Avoid importing external libraries for basic algorithms. Only use those libraries for complicated algorithms
141
- * Most importantly:
142
- * ** Be consistent in the use of these guidelines when submitting**
143
- * Happy coding!
137
+
138
+ - Avoid using global variables and avoid ` == ` .
139
+ - Please use ` let ` over ` var ` .
140
+ - Please refrain from using ` console.log ` or any other console methods.
141
+ - ** Absolutely** don't use ` alert ` .
142
+ - We strongly recommend the use of ECMAScript 6.
143
+ - Avoid importing external libraries for basic algorithms. Only use those libraries for complicated algorithms.
144
+ - Most importantly:
145
+ - ** Be consistent in the use of these guidelines when submitting. **
146
+ - Happy coding!
144
147
145
148
Writer [ @itsvinayak ] ( https://github.com/itsvinayak ) , May 2020.
0 commit comments