Skip to content

Commit 6b65704

Browse files
committed
Update output format
1 parent 84457b9 commit 6b65704

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

JavaScript/1-catch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const sum = (a, b) => new Promise((resolve, reject) => {
1010

1111
sum(7, 'A')
1212
.then(data => {
13-
console.log(data);
13+
console.log({ data });
1414
})
1515
.catch(err => {
16-
console.log(err.message);
16+
console.log({ message: err.message });
1717
});

JavaScript/2-unhandled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const sum = (a, b) => new Promise((resolve, reject) => {
1010

1111
sum(7, 'A')
1212
.then(data => {
13-
console.log(data);
13+
console.log({ data });
1414
});
1515

1616
// UnhandledPromiseRejectionWarning: Error: a and b should be numbers

0 commit comments

Comments
 (0)