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.
This commit is contained in:
parent
7510263654
commit
97cd2fca8d
1 changed files with 1 additions and 1 deletions
|
@ -351,7 +351,7 @@ Please note the additional `[[Environment]]` property is covered here. We didn't
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
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`:
|
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`:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue