ควิซ JavaScript: Operators & Type Coercion

This JavaScript quiz is about type coercion, the automatic conversions that happen when an operator gets values of different types. You will predict the result of +, -, || and ?? on mixed values and learn which values count as falsy.

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

เลือกโหมด

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

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

ข้อ 1 จาก 10

What does this print?

console.log("5" + 3);
ดูเฉลย

C. 53 When either side of + is a string, + joins strings, so 3 becomes "3" and the result is "53". JavaScript does not throw on mixed types here.

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

  • + joins strings, other math operators convert to numbers
  • Left-to-right evaluation in 1 + 2 + \"3\"
  • NaN from failed number conversion
  • Falsy values and || vs ??
  • Why bigint and number don't mix

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

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

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

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

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