GeezerVison is showing github.com — Update code style · HowProgrammingWorks/Errors@f31f5ab
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: JavaScript/4-uncaught.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | 'use strict'; |
2 | 2 |
|
3 | | -process.on('uncaughtException', err => { |
| 3 | +process.on('uncaughtException', (err) => { |
4 | 4 | console.log('on uncaughtException: ' + err.message); |
5 | 5 | process.exit(1); |
6 | 6 | }); |
|
Collapse file
Copy file name to clipboardExpand all lines: JavaScript/5-promise.js +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,18 +9,18 @@ const sum = (a, b) => new Promise((resolve, reject) => { |
9 | 9 | }); |
10 | 10 |
|
11 | 11 | sum(2, 3) |
12 | | - .then(data => { |
| 12 | + .then((data) => { |
13 | 13 | console.log(data); |
14 | 14 | }) |
15 | | - .catch(err => { |
| 15 | + .catch((err) => { |
16 | 16 | console.log(err.message); |
17 | 17 | }); |
18 | 18 |
|
19 | 19 | sum(7, 'A') |
20 | | - .then(data => { |
| 20 | + .then((data) => { |
21 | 21 | console.log(data); |
22 | 22 | }) |
23 | | - .catch(err => { |
| 23 | + .catch((err) => { |
24 | 24 | console.log(err.message); |
25 | 25 | }); |
26 | 26 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: JavaScript/6-async-await.js +6-7Lines changed: 6 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -22,14 +22,13 @@ const sum = async (a, b) => { |
22 | 22 | console.log(err.message); |
23 | 23 | } |
24 | 24 |
|
25 | | -/* |
| 25 | + /* |
26 | 26 | console.log(await sum(7, 'A')); |
27 | 27 |
|
28 | | -UnhandledPromiseRejectionWarning: Error: a and b should be numbers |
29 | | -
|
30 | | -DeprecationWarning: Unhandled promise rejections are deprecated. |
31 | | -In the future, promise rejections that are not handled will terminate |
32 | | -the Node.js process with a non-zero exit code. |
33 | | -*/ |
| 28 | + UnhandledPromiseRejectionWarning: Error: a and b should be numbers |
34 | 29 |
|
| 30 | + DeprecationWarning: Unhandled promise rejections are deprecated. |
| 31 | + In the future, promise rejections that are not handled will terminate |
| 32 | + the Node.js process with a non-zero exit code. |
| 33 | + */ |
35 | 34 | })(); |