> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baenninger.me/llms.txt
> Use this file to discover all available pages before exploring further.

# this Keyword

<AccordionGroup>
  <Accordion title="`this` Schlüsselwort/Variable">
    Spezielle Variable, die für jeden [Execution Context](/web/javascript/javascript-engine-und-performance/execution-context-und-call-stack) (jede Funktion) erstellt wird. Nimmt den Wert des "Eigentümers" der Funktion an, in der das Schlüsselwort `this` verwendet wird (zeigt auf ihn).
  </Accordion>
</AccordionGroup>

`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.

<Info>
  **Method** → `this` = `<object that is calling the method>`

  ```javascript theme={null}
  const jonas = {
  	name: 'Jonas',
  	year: 1989,
  	calcAge: function() {
  		return 2037 - this.year
  	}
  };
  jonas.calcAge();
  ```

  **Simple function call** → `this` = `undefined`

  **Arrow functions** → `this` = `<this of surrounding function (lexical this)>`

  **Event Listener** → `this` = `<DOM element that the hander is attached to>`
</Info>
