Skip to content

Commit 67ed0e0

Browse files
authored
Merge pull request #895 from holub008/master
Mismatched example code and image in promise basics
2 parents bcf8239 + 798840e commit 67ed0e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

1-js/11-async/02-promise-basics/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Here's an example of a Promise constructor and a simple executor function with i
4848
let promise = new Promise(function(resolve, reject) {
4949
// the function is executed automatically when the promise is constructed
5050

51-
// after 1 second signal that the job is done with the result "done!"
52-
setTimeout(() => *!*resolve("done!")*/!*, 1000);
51+
// after 1 second signal that the job is done with the result "done"
52+
setTimeout(() => *!*resolve("done")*/!*, 1000);
5353
});
5454
```
5555

@@ -58,7 +58,7 @@ We can see two things by running the code above:
5858
1. The executor is called automatically and immediately (by the `new Promise`).
5959
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.
6060

61-
After one second of "processing" the executor calls `resolve("done!")` to produce the result:
61+
After one second of "processing" the executor calls `resolve("done")` to produce the result:
6262

6363
![](promise-resolve-1.png)
6464

0 commit comments

Comments
 (0)