PRACTICE / UNDERSTAND / REPEAT

JavaScript MCQ Practice

Predict JavaScript output and test your understanding of scope, types, arrays, and async code.

296 questionsAnswers explainedFree · no login

Put your knowledge to the test.

A random set of up to 10 questions from JavaScript. Your answers stay on this page.

Choose a topic

Try a few questions

Open a topic above to explore the complete question bank.

01 / Values & types · MCQQuestion link ↗

What does `typeof null` return in JavaScript?

Choose one answer
Answer & explanation

Answer: "object"

This is a longstanding JavaScript quirk: `null` is a primitive, but `typeof null` returns `"object"`.

02 / Equality · MCQQuestion link ↗

Which operator compares both value and type without coercion?

Choose one answer
Answer & explanation

Answer: ===

`===` is strict equality. `==` may coerce types; `=` assigns a value.

03 / Closures · MCQQuestion link ↗

What does this function return?

let count = 6;
const next = () => ++count;
next();
Choose one answer
Answer & explanation

Answer: 7

The inner function closes over `count` and keeps access to the binding after `makeCounter` returns.

04 / Promises · MCQQuestion link ↗

Which promise method runs when the promise rejects?

Choose one answer
Answer & explanation

Answer: .catch()

`.catch(handler)` handles rejection. `.finally()` runs after either fulfillment or rejection and does not receive the result.

05 / Arrays · MCQQuestion link ↗

What does `map()` return?

Choose one answer
Answer & explanation

Answer: A new array containing each callback result

`map()` builds a new array from callback return values; it does not mutate the original array by itself.

06 / Declarations · Code recallQuestion link ↗

Complete the declaration so `count` can be reassigned.

___ count = 0;
count += 1;
Answer & explanation

Answer: let

`let` declares a block-scoped variable that can be reassigned.