We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f9a8c26 commit 9e2f8d1Copy full SHA for 9e2f8d1
Answers.md
@@ -45,3 +45,9 @@ function doSomething() {
45
46
The compiler must go 'up' one layer in Scope to find the declaration of thing in order to achieve Closure.
47
48
+## 4. Four rules of the `this` keyword
49
+
50
+1. When a function is contained in the Global Scope, `this` refers to Global/console/window.
51
+2. When a function is called with a preceeding dot, the object before the dot is `this`.
52
+3. When a Constructor Function is used, `this` refers to the Specific Instance of the object created.
53
+4. When `.call` or `.apply` are used, `this` is explicitly defined.
0 commit comments