Fix function parameter
As in example above
This commit is contained in:
parent
706b1f26b2
commit
cae79b54e5
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ We can see two things by running the code above:
|
||||||
1. The executor is called automatically and immediately (by the `new Promise`).
|
1. The executor is called automatically and immediately (by the `new Promise`).
|
||||||
2. The executor receives two arguments: `resolve` and `reject` — these functions are pre-defined by the JavaScript engine. So we don't need to create them. Instead, we should write the executor to call them when ready.
|
2. The executor receives two arguments: `resolve` and `reject` — these functions are pre-defined by the JavaScript engine. So we don't need to create them. Instead, we should write the executor to call them when ready.
|
||||||
|
|
||||||
After one second of "processing" the executor calls `resolve("done")` to produce the result:
|
After one second of "processing" the executor calls `resolve("done!")` to produce the result:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue