- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AI / Machine LearningNeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- QuizzesNew
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
JavaScript Promises Quiz
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.
Sample question
Question 1 of 10What does this print?
const p = Promise.resolve(5);
console.log(typeof p, p instanceof Promise);
Show the answer
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.
What this quiz covers
- 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
Questions people ask
Do I need an account?
No. Anyone can play. Sign in to keep your XP, streak, badges and history.
Can I retake it?
Yes. Your best score is kept, and the questions and answers are shuffled each time.