We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c778b31 commit 0e10d34Copy full SHA for 0e10d34
1 file changed
part6 (Object-Oriented Programming)/07_this.js
@@ -0,0 +1,13 @@
1
+/*
2
+🔹 3. this keyword
3
+✅ What is this?
4
+this refers to the object that is executing the current function.
5
+💡 Rule of Thumb:
6
+Context this refers to
7
+In a method: The object that owns the method
8
+Alone (non-strict): Global object (window)
9
+Alone (strict): undefined
10
+Inside an arrow function Inherits this from the surrounding lexical scope
11
+In event listener The element that received the event
12
+In constructor The newly created object
13
+*/
0 commit comments