JavaScript Operators & Type Coercion Quiz

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.

Medium 10 questions ~6 minutes Pass at 80% Node.js 22

Choose a mode

Playing as a guest: sign in to keep your XP and streak.

Sample question

Question 1 of 10

What does this print?

console.log("5" + 3);
Show the answer

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.

What this quiz covers

  • + 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

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.