Skip to content

Commit fce6919

Browse files
Merge pull request ryanmcdermott#193 from imsobear/fixed-code-style
fix: code style
2 parents 65e1014 + 4733026 commit fce6919

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

README.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -1499,10 +1499,10 @@ class Square extends Shape {
14991499

15001500
function renderLargeShapes(shapes) {
15011501
shapes.forEach((shape) => {
1502-
const area = shape.getArea();
1503-
shape.render(area);
1504-
});
1505-
}
1502+
const area = shape.getArea();
1503+
shape.render(area);
1504+
});
1505+
}
15061506

15071507
const shapes = [new Rectangle(4, 5), new Rectangle(4, 5), new Square(5)];
15081508
renderLargeShapes(shapes);
@@ -1880,29 +1880,29 @@ from `try/catch`.
18801880
**Bad:**
18811881
```javascript
18821882
getdata()
1883-
.then((data) => {
1884-
functionThatMightThrow(data);
1885-
})
1886-
.catch((error) => {
1887-
console.log(error);
1888-
});
1883+
.then((data) => {
1884+
functionThatMightThrow(data);
1885+
})
1886+
.catch((error) => {
1887+
console.log(error);
1888+
});
18891889
```
18901890

18911891
**Good:**
18921892
```javascript
18931893
getdata()
1894-
.then((data) => {
1895-
functionThatMightThrow(data);
1896-
})
1897-
.catch((error) => {
1898-
// One option (more noisy than console.log):
1899-
console.error(error);
1900-
// Another option:
1901-
notifyUserOfError(error);
1902-
// Another option:
1903-
reportErrorToService(error);
1904-
// OR do all three!
1905-
});
1894+
.then((data) => {
1895+
functionThatMightThrow(data);
1896+
})
1897+
.catch((error) => {
1898+
// One option (more noisy than console.log):
1899+
console.error(error);
1900+
// Another option:
1901+
notifyUserOfError(error);
1902+
// Another option:
1903+
reportErrorToService(error);
1904+
// OR do all three!
1905+
});
19061906
```
19071907

19081908
**[⬆ back to top](#table-of-contents)**

0 commit comments

Comments
 (0)