Quiz di JavaScript: async/await

async and await let you write promise code that reads top to bottom. This quiz tests what async functions return, what happens when you forget await, sequential vs parallel waiting and why forEach does not wait for async callbacks.

Medio 10 domande ~6 minuti Superato con il 80% Node.js 22

Scegli una modalità

Stai giocando come ospite: accedi per salvare XP e serie.

Domanda di esempio

Domanda 1 di 10

What does this print?

async function f() {
  return 1;
}
console.log(f() instanceof Promise);
Mostra la risposta

A. true An async function always returns a promise. The returned 1 becomes the promise's value, which you get with await f() or f().then(...).

Cosa copre questo quiz

  • async functions always return a promise
  • What a missing await gives you
  • Sequential vs parallel await
  • await in loops and the forEach trap
  • Where await is allowed

Domande frequenti

Serve un account?

No. Chiunque può giocare. Accedi per salvare XP, serie, badge e cronologia.

Posso rifarlo?

Sì. Il tuo miglior punteggio resta salvato, e domande e risposte vengono mescolate ogni volta.