Quiz de 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.

Médio 10 perguntas ~6 minutos Aprovação com 80% Node.js 22

Escolha um modo

Jogando como visitante: entre para guardar seu XP e sua sequência.

Pergunta de exemplo

Pergunta 1 de 10

What does this print?

console.log("5" + 3);
Mostrar a resposta

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.

O que este quiz cobre

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

Perguntas frequentes

Preciso de uma conta?

Não. Qualquer pessoa pode jogar. Entre para guardar seu XP, sequência, badges e histórico.

Posso refazer?

Pode. Sua melhor nota fica salva, e as perguntas e respostas são embaralhadas a cada vez.