@@ -1499,10 +1499,10 @@ class Square extends Shape {
14991499
15001500function 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
15071507const shapes = [new Rectangle (4 , 5 ), new Rectangle (4 , 5 ), new Square (5 )];
15081508renderLargeShapes (shapes);
@@ -1868,29 +1868,29 @@ from `try/catch`.
18681868** Bad:**
18691869``` javascript
18701870getdata ()
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
18811881getdata ()
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