From 15ff34207200accbe31d1a8074571c1c2f92bfc0 Mon Sep 17 00:00:00 2001 From: Joseph Bak <36170953+josephbak@users.noreply.github.com> Date: Mon, 4 Apr 2022 15:19:32 -0400 Subject: [PATCH] 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. --- 18_Day_Promises/18_day_promises.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/18_Day_Promises/18_day_promises.md b/18_Day_Promises/18_day_promises.md index 22b0c67..6a25137 100644 --- a/18_Day_Promises/18_day_promises.md +++ b/18_Day_Promises/18_day_promises.md @@ -197,7 +197,7 @@ square(2) PromiseĀ {: 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