From c7753486e36d120f82b4c8083d04dd6e82057300 Mon Sep 17 00:00:00 2001 From: Oguntoye Opeyemi Date: Thu, 31 Jan 2019 18:30:15 +0100 Subject: [PATCH] Update article.md Explicitly describe how async functions treat non-promise return values --- 6-async/05-async-await/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/6-async/05-async-await/article.md b/6-async/05-async-await/article.md index 5989fd73..63f50cc0 100644 --- a/6-async/05-async-await/article.md +++ b/6-async/05-async-await/article.md @@ -12,7 +12,7 @@ async function f() { } ``` -The word "async" before a function means one simple thing: a function always returns a promise. If the code has `return ` in it, then JavaScript automatically wraps it into a resolved promise with that value. +The word "async" before a function means one simple thing: a function always returns a promise. Even If a function actually returns a non-promise value, prepending the function definition with the "async" keyword directs Javascript to automatically wrap that value in a resolved promise. For instance, the code above returns a resolved promise with the result of `1`, let's test it: