Last updated 2 years ago
Was this helpful?
JS ⟩ asynchronous ⟩ await ⟩ thenable
"thenable" objects: those with a .then() method.
.then()
If await gets a "thenable" object, it calls .then() and waits for the resolved value.
💾 replit:await thenable
// ----------------------------- // ⭐ "thenable" objects // ----------------------------- // those with a `.then()` method class FutureValue { constructor(value, seconds) { this.value = value; this.seconds = seconds;
JS.info ⟩ async / await