Update task.md
Made it clear what the question was asking from the user.
This commit is contained in:
parent
2d5be7b730
commit
58ee49a958
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
# Call async from non-async
|
# Call async from non-async
|
||||||
|
|
||||||
We have a "regular" function. How to call `async` from it and use its result?
|
We have a "regular" function called f. How can you call the `async` function wait() and use its result inside of f?
|
||||||
|
|
||||||
```js
|
```js
|
||||||
async function wait() {
|
async function wait() {
|
||||||
|
@ -11,7 +11,7 @@ async function wait() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function f() {
|
function f() {
|
||||||
// ...what to write here?
|
// ...what should you write here?
|
||||||
// we need to call async wait() and wait to get 10
|
// we need to call async wait() and wait to get 10
|
||||||
// remember, we can't use "await"
|
// remember, we can't use "await"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue