commit
3efe4cf42a
1 changed files with 1 additions and 1 deletions
|
@ -303,7 +303,7 @@ The `async` keyword before a function has two effects:
|
||||||
|
|
||||||
The `await` keyword before a promise makes JavaScript wait until that promise settles, and then:
|
The `await` keyword before a promise makes JavaScript wait until that promise settles, and then:
|
||||||
|
|
||||||
1. If it's an error, the exception is generated — same as if `throw error` were called at that very place.
|
1. If it's an error, an exception is generated — same as if `throw error` were called at that very place.
|
||||||
2. Otherwise, it returns the result.
|
2. Otherwise, it returns the result.
|
||||||
|
|
||||||
Together they provide a great framework to write asynchronous code that is easy to both read and write.
|
Together they provide a great framework to write asynchronous code that is easy to both read and write.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue