From 1067fccc644a8939fc2f2214bd265b56c60f0dfa Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Mon, 3 Aug 2020 09:33:48 +0530 Subject: [PATCH] update post: Closure and this - How are variables resolved within functions? --- ckddoqwv80154xvs198jkaa5m.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckddoqwv80154xvs198jkaa5m.md b/ckddoqwv80154xvs198jkaa5m.md index 03ead28..c5fa8a6 100644 --- a/ckddoqwv80154xvs198jkaa5m.md +++ b/ckddoqwv80154xvs198jkaa5m.md @@ -146,7 +146,7 @@ Before going further, lets take a small detour. Remember the function scope (`FunctionEnvironment`) and `F.[[ThisMode]]`? Well, this FunctionEnvironment also has 2 internal properties - `env.[[ThisBindingStatus]]` and `env.[[ThisValue]]`. Their values are set based on `F.[[ThisMode]]`. -If `[[ThisMode]]` is lexical, set `[[ThisBindingStatus]]` to 'lexical' and no need of setting `[[ThisValue]]`. +If `[[ThisMode]]` is lexical, set `[[ThisBindingStatus]]` to 'lexical' and no need of setting `[[ThisValue]]`. If `[[ThisMode]]` is non-lexical, set `[[ThisBindingStatus]]` to 'initialized' and set `[[ThisValue]]` to the actual `this` that the function was called with. In summary, the function scope has 2 properties which say - whether the scope has a `this` value or not and if it has, then what is the value. Arrow functions will not have any `this` value, but normal functions will.