Skip to content

Commit

Permalink
minor correction
Browse files Browse the repository at this point in the history
  • Loading branch information
Asabeneh committed Apr 16, 2022
1 parent 0d064ad commit 8b4f5a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 18_Day_Promises/18_day_promises.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ square(2)
Promise {<resolved>: 4}
```

The word _async_ in front of a function means that function will return a promise. The above square function instead of a value it returned a promise.
The word _async_ in front of a function means that function will return a promise. The above square function instead of a value it returns a promise.

How do we access the value from the promise? To access the value from the promise, we will use the keyword _await_.

Expand All @@ -206,6 +206,7 @@ const square = async function (n) {
return n * n
}
const value = await square(2)
console.log(value)
```

```sh
Expand Down

0 comments on commit 8b4f5a7

Please sign in to comment.