Skip to content

Commit f31f5ab

Browse files
committed
Update code style
1 parent 88165c5 commit f31f5ab

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

JavaScript/4-uncaught.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
process.on('uncaughtException', err => {
3+
process.on('uncaughtException', (err) => {
44
console.log('on uncaughtException: ' + err.message);
55
process.exit(1);
66
});

JavaScript/5-promise.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ const sum = (a, b) => new Promise((resolve, reject) => {
99
});
1010

1111
sum(2, 3)
12-
.then(data => {
12+
.then((data) => {
1313
console.log(data);
1414
})
15-
.catch(err => {
15+
.catch((err) => {
1616
console.log(err.message);
1717
});
1818

1919
sum(7, 'A')
20-
.then(data => {
20+
.then((data) => {
2121
console.log(data);
2222
})
23-
.catch(err => {
23+
.catch((err) => {
2424
console.log(err.message);
2525
});
2626

JavaScript/6-async-await.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ const sum = async (a, b) => {
2222
console.log(err.message);
2323
}
2424

25-
/*
25+
/*
2626
console.log(await sum(7, 'A'));
2727
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
3429
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+
*/
3534
})();

0 commit comments

Comments
 (0)