Output-Based JavaScript Questions

This JavaScript quiz collects the "what does this print?" snippets that come up again and again in interviews. You will reason about typeof, type coercion, hoisting, this, sorting and the order of timers and promises.

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(typeof null, typeof [], typeof NaN);
Mostrar a resposta

A. object object number typeof null is "object", a famous historical bug. Arrays are objects (use Array.isArray() to tell them apart), and NaN is a value of type number.

O que este quiz cobre

  • typeof surprises and floating point results
  • Coercion with + and ==
  • Hoisting of var and function expressions
  • this in regular vs arrow callbacks
  • Microtasks vs setTimeout order

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.