ควิซ 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.

ปานกลาง 10 ข้อ ~6 นาที ผ่านที่ 80% Node.js 22

เลือกโหมด

กำลังเล่นแบบผู้เยี่ยมชม: เข้าสู่ระบบเพื่อเก็บ XP และ streak

ตัวอย่างคำถาม

ข้อ 1 จาก 10

What does this print?

async function f() {
  return 1;
}
console.log(f() instanceof Promise);
ดูเฉลย

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(...).

ควิซนี้มีเนื้อหาอะไรบ้าง

  • 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

คำถามที่พบบ่อย

ต้องมีบัญชีไหม?

ไม่ต้อง ใครก็เล่นได้ เข้าสู่ระบบเพื่อเก็บ XP, streak, เหรียญตรา และประวัติ

ทำซ้ำได้ไหม?

ได้ ระบบเก็บคะแนนที่ดีที่สุดไว้ และสลับคำถามกับตัวเลือกใหม่ทุกครั้ง