Skip to content

Commit 4733026

Browse files
committed
fix: code style
1 parent 3a25ed2 commit 4733026

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);
@@ -1868,29 +1868,29 @@ from `try/catch`.
18681868
**Bad:**
18691869
```javascript
18701870
getdata()
1871-
.then((data) => {
1872-
functionThatMightThrow(data);
1873-
})
1874-
.catch((error) => {
1875-
console.log(error);
1876-
});
1871+
.then((data) => {
1872+
functionThatMightThrow(data);
1873+
})
1874+
.catch((error) => {
1875+
console.log(error);
1876+
});
18771877
```
18781878

18791879
**Good:**
18801880
```javascript
18811881
getdata()
1882-
.then((data) => {
1883-
functionThatMightThrow(data);
1884-
})
1885-
.catch((error) => {
1886-
// One option (more noisy than console.log):
1887-
console.error(error);
1888-
// Another option:
1889-
notifyUserOfError(error);
1890-
// Another option:
1891-
reportErrorToService(error);
1892-
// OR do all three!
1893-
});
1882+
.then((data) => {
1883+
functionThatMightThrow(data);
1884+
})
1885+
.catch((error) => {
1886+
// One option (more noisy than console.log):
1887+
console.error(error);
1888+
// Another option:
1889+
notifyUserOfError(error);
1890+
// Another option:
1891+
reportErrorToService(error);
1892+
// OR do all three!
1893+
});
18941894
```
18951895

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

0 commit comments

Comments
 (0)