mirror of
https://github.com/bendtherules/blog-hashnode-backup.git
synced 2026-08-18 13:42:04 +00:00
update post: Closure and this - How are variables resolved within functions?
This commit is contained in:
@@ -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`.
|
||||
|
||||
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?
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user