update post: Closure and this - How are variables resolved within functions?

This commit is contained in:
2020-08-03 09:44:28 +05:30
parent cb53ce7ea3
commit 8f7d0d20f7
+2
View File
@@ -176,6 +176,8 @@ b. else, move up to parent scope and repeat.
It will finally reach global scope, which always provides a `this` value (global object). For modules, it will stop at the module scope - whose `this` value is `undefined`. It will finally reach global scope, which always provides a `this` value (global object). For modules, it will stop at the module scope - whose `this` value is `undefined`.
In short, it means that the value of `this` will be resolved from the closest `this`-providing scope. (Follow the table above.)
### What does this explain? ### What does this explain?