Tricky JavaScript Questions

This hard JavaScript quiz goes after the language's strangest corners. You will untangle coercion, parseInt with map, object keys, the temporal dead zone and automatic semicolon insertion, and explain why each result happens.

ยาก 10 ข้อ ~8 นาที ผ่านที่ 80% Node.js 22

เลือกโหมด

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

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

ข้อ 1 จาก 10

What does this print?

console.log([] + {}, typeof ([] + {}));
ดูเฉลย

B. [object Object] string + with objects converts both sides to primitives: [] becomes "" and {} becomes "[object Object]". One of them is a string, so the result is string concatenation.

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

  • Coercion of arrays and objects to strings and booleans
  • map(parseInt) and other argument surprises
  • Objects used as property keys
  • The temporal dead zone of let
  • Automatic semicolon insertion after return

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

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

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

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

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