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.

Medio 10 domande ~6 minuti Superato con il 80% Node.js 22

Scegli una modalità

Stai giocando come ospite: accedi per salvare XP e serie.

Domanda di esempio

Domanda 1 di 10

What does this print?

console.log(typeof null, typeof [], typeof NaN);
Mostra la risposta

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.

Cosa copre questo quiz

  • 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

Domande frequenti

Serve un account?

No. Chiunque può giocare. Accedi per salvare XP, serie, badge e cronologia.

Posso rifarlo?

Sì. Il tuo miglior punteggio resta salvato, e domande e risposte vengono mescolate ogni volta.