File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,24 @@ var yearMonthDay = moment().format('YYYY/MM/DD');
5252```
5353** [ ⬆ back to top] ( #table-of-contents ) **
5454
55+ ### Use ES6 constants when variable values do not change
56+ In the bad example, the variable can be changed.
57+ When you declare a constant, the variable should stay
58+ the same throughout the program.
59+
60+
61+ ** Bad:**
62+ ``` javascript
63+ var FIRST_US_PRESIDENT = " George Washington" ;
64+ ```
65+
66+ ** Good** :
67+ ``` javascript
68+ const FIRST_US_PRESIDENT = " George Washington" ;
69+ ```
70+ ** [ ⬆ back to top] ( #table-of-contents ) **
71+
72+
5573### Use the same vocabulary for the same type of variable
5674
5775** Bad:**
@@ -1951,7 +1969,7 @@ function hashIt(data) {
19511969```
19521970** [ ⬆ back to top] ( #table-of-contents ) **
19531971
1954- ### Don't leave commented code in your codebase
1972+ ### Don't leave commented out code in your codebase
19551973Version control exists for a reason. Leave old code in your history.
19561974
19571975** Bad:**
You can’t perform that action at this time.
0 commit comments