From 97cd2fca8d44b8ae5537269bda146e3cd454e7cc Mon Sep 17 00:00:00 2001 From: lumosmind <12192118+lumosmind@users.noreply.github.com> Date: Tue, 29 Oct 2019 21:33:42 +0300 Subject: [PATCH] function declaration vs function call conflict function() { return count++; } is running because it is a function declaration. It is running and result of this running a function has been created and sent as a parameter to return command. "return count++;" this part is not running because the function has not been called yet. --- 1-js/06-advanced-functions/03-closure/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/06-advanced-functions/03-closure/article.md b/1-js/06-advanced-functions/03-closure/article.md index 33225790..8dc1eae9 100644 --- a/1-js/06-advanced-functions/03-closure/article.md +++ b/1-js/06-advanced-functions/03-closure/article.md @@ -351,7 +351,7 @@ Please note the additional `[[Environment]]` property is covered here. We didn't ![](lexenv-nested-makecounter-3.svg) - Please note that on this step the inner function was created, but not yet called. The code inside `function() { return count++; }` is not running. + Please note that on this step the inner function was created, but not yet called. The code inside `return count++;` is not running. 4. As the execution goes on, the call to `makeCounter()` finishes, and the result (the tiny nested function) is assigned to the global variable `counter`: