From 8e1c2a9566a6d5c1b35da46398d339c0c8637c2d Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Fri, 3 Apr 2020 09:44:53 +0530 Subject: [PATCH] update post: What is `this` inside foo.bar()? --- ck8dzlitm01atxjs1322jz9a2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ck8dzlitm01atxjs1322jz9a2.md b/ck8dzlitm01atxjs1322jz9a2.md index 0a6c6f6..c62de65 100644 --- a/ck8dzlitm01atxjs1322jz9a2.md +++ b/ck8dzlitm01atxjs1322jz9a2.md @@ -48,7 +48,7 @@ One example of this is rewriting `foo.bar()` using a intermediate variable - ` f So, if `bar` was referencing other values from foo using `this`, those values will become undefined or resolve to a wrong variable. -🧠 This is exactly the reason why passing methods as callback changes the value of `this` (passed within it). Instead of calling a method directly, callback is passed as a function and called later by some other code. +🧠 This is exactly the reason why passing methods as callback changes the value of `this` (passed within it). Instead of calling a method directly, callback is actually passed as a function and this function is later called by some other code. ## In other words,