Fixes in 18_day_promises.md

Fixed some typos and added a line of code to print a value in the Async and Await section in 18_day_promises.md.
pull/308/head
Joseph Bak 4 years ago committed by GitHub
parent a22baede03
commit 15ff342072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 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_.
@ -206,6 +206,7 @@ const square = async function (n) {
return n * n
}
const value = await square(2)
console.log(value)
```
```sh

Loading…
Cancel
Save