minor fixes

This commit is contained in:
Ilya Kantor 2020-08-04 10:29:29 +03:00
parent 4133532cd8
commit 0e592a95c7

View file

@ -67,7 +67,7 @@ f();
The function execution "pauses" at the line `(*)` and resumes when the promise settles, with `result` becoming its result. So the code above shows "done!" in one second.
Let's emphasize: `await` literally suspends the function execution until the promise settles, and then resumes with the result. That doesn't cost any CPU resources, because the JavaScript engine can do other jobs in the meantime: execute other scripts, handle events, etc.
Let's emphasize: `await` literally suspends the function execution until the promise settles, and then resumes it with the result. That doesn't cost any CPU resources, because the JavaScript engine can do other jobs in the meantime: execute other scripts, handle events, etc.
It's just a more elegant syntax of getting the promise result than `promise.then`, easier to read and write.