`this` Schlüsselwort/Variable
`this` Schlüsselwort/Variable
Spezielle Variable, die für jeden Execution Context (jede Funktion) erstellt wird. Nimmt den Wert des “Eigentümers” der Funktion an, in der das Schlüsselwort
this verwendet wird (zeigt auf ihn).this ist nicht statisch. Es hängt davon ab, wie die Funktion aufgerufen wird, und der Wert wird erst zugewiesen, wenn die Funktion tatsächlich aufgerufen wird.
Method → Simple function call →
this = <object that is calling the method>this = undefinedArrow functions → this = <this of surrounding function (lexical this)>Event Listener → this = <DOM element that the hander is attached to>