Promises in JavaScript

ModuleAsync/Await

Promises are a way to handle asynchronous operations in JavaScript. They represent a value that will be available later – either successfully (resolved) or with an error (rejected).

Before Promises, callbacks were used (callback hell). Promises make async code cleaner and easier to read.

Promise States

  • Pending – initial state
  • Fulfilled – resolved successfully
  • Rejected – failed with an error

Creating a Promise

Consuming Promises with .then/.catch

Chaining Promises

Promise.all, race, any, allSettled

.finally()

Quick Quiz

Wir haben die Materialien überprüft, dennoch können Fehler vorkommen. Der Inhalt dient ausschließlich Bildungszwecken, daher verwende ihn auf eigene Verantwortung und überprüfe ihn bei Bedarf mit anderen Quellen.

✨ Frag Lara — deine KI-Lernpartnerin

Entsperre personalisierte Lernunterstützung. Lara kann Lektionen erklären, Themen zusammenfassen und deine Lernfragen beantworten — verfügbar ab dem Go-Tarif.


Lara hilft dir, schneller zu lernen — exklusiv für ReadyTools Go-, Plus- und Max-Mitglieder.

Verfolge deinen Fortschritt 🚀

Lerne einfacher, indem du deinen Fortschritt kostenlos verfolgst.