Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6fcbece

Browse files
committed
fix new instances of previously fixed cases
Add missed semicolons. Comment out ellipses. Use object shorthand. Delete block padding. Delete default constructors.
1 parent 383dd49 commit 6fcbece

File tree

1 file changed

+13
-25
lines changed

1 file changed

+13
-25
lines changed

README.md

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ can help identify unnamed constants.
8181
```javascript
8282
// What the heck is 86400 for?
8383
setTimeout(() => {
84-
this.blastOff()
84+
this.blastOff();
8585
}, 86400);
8686

8787
```
@@ -92,7 +92,7 @@ setTimeout(() => {
9292
const SECONDS_IN_A_DAY = 86400;
9393

9494
setTimeout(() => {
95-
this.blastOff()
95+
this.blastOff();
9696
}, SECONDS_IN_A_DAY);
9797

9898
```
@@ -183,15 +183,15 @@ function paintCar(car) {
183183
```javascript
184184
function createMicrobrewery(name) {
185185
const breweryName = name || 'Hipster Brew Co.';
186-
...
186+
// ...
187187
}
188188

189189
```
190190

191191
**Good**:
192192
```javascript
193193
function createMicrobrewery(breweryName = 'Hipster Brew Co.') {
194-
...
194+
// ...
195195
}
196196

197197
```
@@ -382,9 +382,9 @@ function showDeveloperList(developers) {
382382
const experience = developer.getExperience();
383383
const githubLink = developer.getGithubLink();
384384
const data = {
385-
expectedSalary: expectedSalary,
386-
experience: experience,
387-
githubLink: githubLink
385+
expectedSalary,
386+
experience,
387+
githubLink
388388
};
389389

390390
render(data);
@@ -397,9 +397,9 @@ function showManagerList(managers) {
397397
const experience = manager.getExperience();
398398
const portfolio = manager.getMBAProjects();
399399
const data = {
400-
expectedSalary: expectedSalary,
401-
experience: experience,
402-
portfolio: portfolio
400+
expectedSalary,
401+
experience,
402+
portfolio
403403
};
404404

405405
render(data);
@@ -421,9 +421,9 @@ function showList(employees) {
421421
}
422422

423423
const data = {
424-
expectedSalary: expectedSalary,
425-
experience: experience,
426-
portfolio: portfolio
424+
expectedSalary,
425+
experience,
426+
portfolio
427427
};
428428

429429
render(data);
@@ -448,7 +448,6 @@ function createMenu(config) {
448448
config.body = config.body || 'Bar';
449449
config.buttonText = config.buttonText || 'Baz';
450450
config.cancellable = config.cancellable === undefined ? config.cancellable : true;
451-
452451
}
453452

454453
createMenu(menuConfig);
@@ -585,10 +584,6 @@ Array.prototype.diff = function diff(comparisonArray) {
585584
**Good:**
586585
```javascript
587586
class SuperArray extends Array {
588-
constructor(...args) {
589-
super(...args);
590-
}
591-
592587
diff(comparisonArray) {
593588
const values = [];
594589
const hash = {};
@@ -1124,10 +1119,6 @@ class Rectangle {
11241119
}
11251120

11261121
class Square extends Rectangle {
1127-
constructor() {
1128-
super();
1129-
}
1130-
11311122
setWidth(width) {
11321123
this.width = width;
11331124
this.height = width;
@@ -1155,8 +1146,6 @@ renderLargeRectangles(rectangles);
11551146
**Good**:
11561147
```javascript
11571148
class Shape {
1158-
constructor() {}
1159-
11601149
setColor(color) {
11611150
// ...
11621151
}
@@ -1607,7 +1596,6 @@ class Employee {
16071596
constructor(name, email) {
16081597
this.name = name;
16091598
this.email = email;
1610-
16111599
}
16121600

16131601
setTaxData(ssn, salary) {

0 commit comments

Comments
 (0)