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

# Prototypes

Prototypes sind ähnlich zu Klassen im klassischen OOP. Dabei enthält ein Prototype Methoden und ein Objekt kann auf diese Methoden zugreifen.

* Objekte sind verknüpft mit dem Prototype-Objekt
* **Prototypal Inheritance**: Der Prototype beinhaltet alle Methoden, welche für alle verknüpften Objekte zugänglich sind.
* Verhalten wird zum verknüpften Prototype Objekt delegiert.

## Beispiel

Wenn wir die `map`-Funktion auf einem Array nutzen, dann nutzen wir eigentlich die Methode vom `Array`-Prototype.

<Frame caption="Array-Prototype">
  <img src="https://mintcdn.com/levexis-38849a2b/fK05ZPeHGTgSfJjo/images/content/web/image.png?fit=max&auto=format&n=fK05ZPeHGTgSfJjo&q=85&s=dbccbfa1ac351c0d28f0f12f1942ed35" alt="Array-Prototype" width="290" height="549" data-path="images/content/web/image.png" />
</Frame>

## Prototypal Inheritance

<Frame caption="Prototypal Inheritance">
  <img src="https://mintcdn.com/levexis-38849a2b/fK05ZPeHGTgSfJjo/images/content/web/image-1.png?fit=max&auto=format&n=fK05ZPeHGTgSfJjo&q=85&s=d393364fd638aeb733f9575d6536a66a" alt="Prototypal Inheritance" width="1916" height="947" data-path="images/content/web/image-1.png" />
</Frame>

## Prototype Chain

<Frame caption="Prototype Chain">
  <img src="https://mintcdn.com/levexis-38849a2b/fK05ZPeHGTgSfJjo/images/content/web/image-2.png?fit=max&auto=format&n=fK05ZPeHGTgSfJjo&q=85&s=a29a57c292a896592897c8ec5dc2a56c" alt="Prototype Chain" width="1918" height="948" data-path="images/content/web/image-2.png" />
</Frame>
