You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -46,13 +46,13 @@ Algorithms in this repo should not be how-to examples for existing JavaScript pa
46
46
47
47
#### File Naming Convention
48
48
- filenames should use the UpperCamelCase (PascalCase) style.
49
-
- There should be no spaces in filenames.
49
+
- There should be no spaces in filenames.
50
50
**Example:**`UserProfile.js` is allowed but `userprofile.js`,`Userprofile.js`,`user-Profile.js`,`userProfile.js` are not
51
51
52
52
#### Testing
53
53
54
-
Be confident that your code works. When was the last time you committed a code change, your build failed, and half of your app stopped working? Mine was last week. Writing tests for our Algorithms will help us ensure the implementations are air tight even after multiple fixes and code changes.
55
-
We use a NPM package [doctest](https://www.npmjs.com/package/doctest) to add basic testing functionality to our code. Doctests are simple structured comments that evaluate an function and ensure a required result.
54
+
Be confident that your code works. When was the last time you committed a code change, your build failed, and half of your app stopped working? Mine was last week. Writing tests for our Algorithms will help us ensure the implementations are air tight even after multiple fixes and code changes.
55
+
We use a NPM package [doctest](https://www.npmjs.com/package/doctest) to add basic testing functionality to our code. Doctests are simple structured comments that evaluate a function and ensure a required result.
56
56
57
57
The implementation of doctest is quite simple. You can easily learn it [here](https://www.npmjs.com/package/doctest).
58
58
@@ -76,23 +76,23 @@ To maximize the readability and correctness of our code, we require that new sub
76
76
$ standard MyFile.js // if that fails, try: npx standard MyFile.js
77
77
```
78
78
79
-
- Use camelCase for with leading character lowercase for identifier names (variables and functions)
79
+
- Use camelCase with the leading character as lowercase for identifier names (variables and functions)
80
80
- Names start with a letter
81
81
- follow code indentation
82
82
- Always use 2 spaces for indentation of code blocks
83
83
```
84
84
function sumOfArray (arrayOfNumbers) {
85
-
let sum = 0
86
-
for (let i = 0; i < arrayOfNumbers.length; i++) {
87
-
sum += arrayOfNumbers[i]
88
-
}
89
-
return (sum)
85
+
let sum = 0
86
+
for (let i = 0; i < arrayOfNumbers.length; i++) {
87
+
sum += arrayOfNumbers[i]
90
88
}
89
+
return (sum)
90
+
}
91
91
92
92
```
93
93
- Avoid using global variables and avoid '=='
94
94
- Please use 'let' over 'var'
95
-
- Please use 'console.log()'
95
+
- Please use 'console.log()'
96
96
- We strongly recommend the use of ECMAScript 6
97
97
- Avoid importing external libraries for basic algorithms. Only use those libraries for complicated algorithms.
0 commit comments