How to use the JavaScript MCQ Quiz
- 1. Pick the lengthChoose 10 JavaScript questions or all 21, with shuffle on or off.
- 2. Answer each questionTap an option to see at once if it is right, plus a short JavaScript explanation.
- 3. See your scoreFinish to get your JavaScript score and a review of all your answers.
What this quiz covers
JavaScript interviews often ask you to predict what a line of code prints. This quiz focuses on exactly those areas:
- Types and coercion: typeof null, "5" − 3, [] + [], truthy and falsy values, and 0.1 + 0.2.
- Scope and hoisting: var vs let, the temporal dead zone, and const with objects.
- Functions: arrow functions and this.
- Arrays and objects: map vs forEach, reduce, push, spread and optional chaining.
- Async: Promise.all, setTimeout and the event loop.
- DOM events: bubbling and stopPropagation.
Worked example and how to use it
Example from the quiz: What does console.log(x); var x = 5; print? The answer is undefined. The declaration var x is hoisted to the top of its scope and set to undefined; the value 5 is only assigned when that line runs. Change var to let and you get a ReferenceError instead, because let variables cannot be used before their declaration.
Every output answer in this quiz was checked by running the code in Node.js, so you can trust the explanations. When a result surprises you, paste the code into our JavaScript compiler and play with it. For async questions, the event loop visualizer shows step by step why promises run before timers.
Aim for 80% or more before a front-end interview, and redo the quiz with shuffle on until the tricky ones feel obvious.
Frequently asked questions
Does it cover ES6 and later?
Yes: let and const, arrow functions, spread, optional chaining and promises are all included.
Are the answers tested?
Yes. Every code-output answer was checked by running it in Node.js.
How long does it take?
A 10-question round takes about 5 minutes. All 21 take around 10 to 12 minutes.
Is it free?
Yes. The questions are free to answer. Your final score asks for your name and WhatsApp number once, and you will not be asked again on any Uncodemy tool.