- Esecutori
-
Impara
Impara Python Esempi eseguibili, NumPy, pandas e altro Impara l'IA / Machine LearningReti neurali, ML e LLM da zero Impara C e C++ Puntatori, memoria, STL e C++ moderno Impara C#Fondamenti, OOP, LINQ, async ed esercizi .NET Impara MatplotlibGrafici a linee, barre, dispersione e torta con visualizzatori Impara RustOwnership, trait, gestione degli errori e thread Impara GoSlice, interfacce, goroutine e canali Algoritmi Python Ricerca, ordinamento, ricorsione e visualizzazioni O(n) Algoritmi C e C++ Confronta le implementazioni in C e C++ Programmazione per bambini Impara a programmare giocando!
- QuizNuovo
- SfideNuovo
- Per docentiNuovo
- Aggiornamenti
- Offrimi un caffè
Quiz di JavaScript: Promises
Promises are the foundation of asynchronous JavaScript. This quiz tests how a promise settles, what each .then() passes to the next one, how rejections skip ahead to .catch() and what .finally() does with values.
Domanda di esempio
Domanda 1 di 10What does this print?
const p = Promise.resolve(5);
console.log(typeof p, p instanceof Promise);
Mostra la risposta
B. object true A promise is an object, so typeof gives 'object'. Promise.resolve(5) wraps the value 5; you get the 5 only inside .then() or with await.
Cosa copre questo quiz
- Promise states and settling only once
- Values flowing through a
.then()chain - Returning a promise from
.then() .catch()and.finally()in a chain- Forgetting to return a promise
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.