You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/11-async/02-promise-basics/article.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,8 +48,8 @@ Here's an example of a Promise constructor and a simple executor function with i
48
48
let promise =newPromise(function(resolve, reject) {
49
49
// the function is executed automatically when the promise is constructed
50
50
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);
53
53
});
54
54
```
55
55
@@ -58,7 +58,7 @@ We can see two things by running the code above:
58
58
1. The executor is called automatically and immediately (by the `new Promise`).
59
59
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.
60
60
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:
0 commit comments