Skip to main content

Prototypen: Einer für alle

  • Chapter
  • First Online:
  • 9758 Accesses

Zusammenfassung

Im letzten Kapitel haben wir gesehen, dass Klassen ihre Entsprechung in JavaScript darin finden, wenn mit einem Konstruktor Objekte nach einem gemeinsamen Bauplan erzeugt werden. Dabei werden – anders als in klassenbasierten Programmiersprachen wie C++ und Java – bei jedem Aufruf eines Konstruktors nicht nur die Attributwerte initialisiert. Vielmehr findet bei jedem Aufruf der komplette Prozess der Objekterstellung statt. Dabei werden zunächst die Attribute und Methoden als solche angelegt. Außerdem werden die „Werte“ der Methoden initialisiert, das heißt, dem Bezeichner einer Methode wird ein Function-Objekt zugewiesen – in der Regel in jeder Objekt-Instanz mit gleichem Inhalt.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   29.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jörg Bewersdorff .

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer Fachmedien Wiesbaden

About this chapter

Cite this chapter

Bewersdorff, J. (2014). Prototypen: Einer für alle. In: Objektorientierte Programmierung mit JavaScript. Springer Vieweg, Wiesbaden. https://doi.org/10.1007/978-3-658-05444-1_14

Download citation

Publish with us

Policies and ethics