JavaScript Quiz: 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.

मीडियम 10 सवाल ~6 मिनट पास होने के लिए 80% Node.js 22

मोड चुनें

आप गेस्ट के तौर पर खेल रहे हैं: XP और streak सेव रखने के लिए साइन इन करें।

सैंपल सवाल

सवाल 1 / 10

What does this print?

const p = Promise.resolve(5);
console.log(typeof p, p instanceof Promise);
जवाब दिखाएं

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.

इस क्विज़ में क्या है

  • 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

अक्सर पूछे जाने वाले सवाल

क्या अकाउंट ज़रूरी है?

नहीं। कोई भी खेल सकता है। XP, streak, badge और हिस्ट्री सेव रखने के लिए साइन इन करें।

क्या मैं इसे दोबारा दे सकता हूं?

हां। आपका बेस्ट स्कोर सेव रहता है, और हर बार सवाल और जवाब शफ़ल होते हैं।