mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-30 12:40:03 +02:00
Merge pull request #3873 from the-land-mine/master
fix: Correct syntax error in Promise initialization example by adding space
This commit is contained in:
@@ -5,7 +5,7 @@ Asynchronous functions use promise behind the scenes, so understanding how promi
|
|||||||
Once a promise has been called, it will start in a pending state. This means that the calling function continues executing, while the promise is pending until it resolves, giving the calling function whatever data was being requested.
|
Once a promise has been called, it will start in a pending state. This means that the calling function continues executing, while the promise is pending until it resolves, giving the calling function whatever data was being requested.
|
||||||
|
|
||||||
Creating a Promise:
|
Creating a Promise:
|
||||||
The Promise API exposes a Promise constructor, which you initialize using newPromise().
|
The Promise API exposes a Promise constructor, which you initialize using new Promise().
|
||||||
|
|
||||||
Using resolve() and reject(), we can communicate back to the caller what the resulting Promise state was, and what to do with it.
|
Using resolve() and reject(), we can communicate back to the caller what the resulting Promise state was, and what to do with it.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user