@@ -81,7 +81,7 @@ can help identify unnamed constants.
81
81
``` javascript
82
82
// What the heck is 86400000 for?
83
83
setTimeout (() => {
84
- this .blastOff ()
84
+ this .blastOff ();
85
85
}, 86400000 );
86
86
87
87
```
@@ -92,7 +92,7 @@ setTimeout(() => {
92
92
const MILLISECONDS_IN_A_DAY = 86400000 ;
93
93
94
94
setTimeout (() => {
95
- this .blastOff ()
95
+ this .blastOff ();
96
96
}, MILLISECONDS_IN_A_DAY );
97
97
98
98
```
@@ -183,15 +183,15 @@ function paintCar(car) {
183
183
``` javascript
184
184
function createMicrobrewery (name ) {
185
185
const breweryName = name || ' Hipster Brew Co.' ;
186
- ...
186
+ // ...
187
187
}
188
188
189
189
```
190
190
191
191
** Good** :
192
192
``` javascript
193
193
function createMicrobrewery (breweryName = ' Hipster Brew Co.' ) {
194
- ...
194
+ // ...
195
195
}
196
196
197
197
```
@@ -382,9 +382,9 @@ function showDeveloperList(developers) {
382
382
const experience = developer .getExperience ();
383
383
const githubLink = developer .getGithubLink ();
384
384
const data = {
385
- expectedSalary: expectedSalary ,
386
- experience: experience ,
387
- githubLink: githubLink
385
+ expectedSalary,
386
+ experience,
387
+ githubLink
388
388
};
389
389
390
390
render (data);
@@ -397,9 +397,9 @@ function showManagerList(managers) {
397
397
const experience = manager .getExperience ();
398
398
const portfolio = manager .getMBAProjects ();
399
399
const data = {
400
- expectedSalary: expectedSalary ,
401
- experience: experience ,
402
- portfolio: portfolio
400
+ expectedSalary,
401
+ experience,
402
+ portfolio
403
403
};
404
404
405
405
render (data);
@@ -421,9 +421,9 @@ function showList(employees) {
421
421
}
422
422
423
423
const data = {
424
- expectedSalary: expectedSalary ,
425
- experience: experience ,
426
- portfolio: portfolio
424
+ expectedSalary,
425
+ experience,
426
+ portfolio
427
427
};
428
428
429
429
render (data);
@@ -448,7 +448,6 @@ function createMenu(config) {
448
448
config .body = config .body || ' Bar' ;
449
449
config .buttonText = config .buttonText || ' Baz' ;
450
450
config .cancellable = config .cancellable === undefined ? config .cancellable : true ;
451
-
452
451
}
453
452
454
453
createMenu (menuConfig);
@@ -585,10 +584,6 @@ Array.prototype.diff = function diff(comparisonArray) {
585
584
** Good:**
586
585
``` javascript
587
586
class SuperArray extends Array {
588
- constructor (... args ) {
589
- super (... args);
590
- }
591
-
592
587
diff (comparisonArray ) {
593
588
const values = [];
594
589
const hash = {};
@@ -1124,10 +1119,6 @@ class Rectangle {
1124
1119
}
1125
1120
1126
1121
class Square extends Rectangle {
1127
- constructor () {
1128
- super ();
1129
- }
1130
-
1131
1122
setWidth (width ) {
1132
1123
this .width = width;
1133
1124
this .height = width;
@@ -1155,8 +1146,6 @@ renderLargeRectangles(rectangles);
1155
1146
** Good** :
1156
1147
``` javascript
1157
1148
class Shape {
1158
- constructor () {}
1159
-
1160
1149
setColor (color ) {
1161
1150
// ...
1162
1151
}
@@ -1607,7 +1596,6 @@ class Employee {
1607
1596
constructor (name , email ) {
1608
1597
this .name = name;
1609
1598
this .email = email;
1610
-
1611
1599
}
1612
1600
1613
1601
setTaxData (ssn , salary ) {
0 commit comments