Skip to content

Commit 3068c05

Browse files
authored
Update 7-await.js
throw not reject
1 parent 4f3c283 commit 3068c05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

JavaScript/7-await.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const sum = async (a, b) => {
44
if (typeof(a) === 'number' && typeof(b) === 'number') {
55
return a + b;
66
} else {
7-
return Promise.reject(new Error('a and b should be numbers'));
7+
throw new Error('a and b should be numbers');
88
}
99
};
1010

0 commit comments

Comments
 (0)