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

Mittel 10 Fragen ~6 Minuten Bestanden ab 80% Node.js 22

Modus wählen

Du spielst als Gast: Melde dich an, damit XP und Serie gespeichert werden.

Beispielfrage

Frage 1 von 10

What does this print?

console.log("5" + 3);
Lösung zeigen

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.

Darum geht es in diesem Quiz

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

Häufige Fragen

Brauche ich ein Konto?

Nein. Jeder kann spielen. Mit Anmeldung werden XP, Serie, Abzeichen und Verlauf gespeichert.

Kann ich es wiederholen?

Ja. Dein Bestwert bleibt erhalten, und Fragen und Antworten werden jedes Mal neu gemischt.