JavaScript Objective Questions and Answers

Practice JavaScript objective questions with answers and clear explanations. Covers core JavaScript, ES6+, closures, scope, hoisting, async programming, promises, event loop, prototypes, memory management, and advanced language concepts.

This JavaScript quiz contains carefully curated objective questions with correct answers and clear explanations. It is designed for frontend and backend developers, interview preparation, and deep understanding of modern JavaScript concepts including ES6+, asynchronous behavior, scope, closures, and performance pitfalls.

Practice JavaScript MCQs with Detailed Explanations

Answer at least 12 questions to submit.

1.
What will be the output of the following code? console.log(typeof null);
Easy
2.
What is the output? console.log(0.1 + 0.2 === 0.3);
Easy
3.
What will be logged? let x = 5; (function () { console.log(x); let x = 10; })();
Medium
4.
What is the output? console.log([] + []);
Medium
5.
Which statement about closures is correct?
Medium
6.
What will be the output? console.log(typeof NaN);
Medium
7.
What does Object.freeze() do?
Medium
8.
What is the output? console.log([1, 2] == "1,2");
Medium
9.
Which array method does NOT mutate the original array?
Medium
10.
What will be printed? console.log(foo); var foo = 10;
Medium
11.
What is logged? console.log(!!"false");
Medium
12.
Which keyword prevents reassignment but allows mutation?
Medium
13.
What will be logged? console.log([] == ![]);
High
14.
Which mechanism enables asynchronous behavior in JavaScript?
Medium
15.
What does the following return? (() => { return arguments; })();
High
Answered: 0 / 15