JavaScript Objective Questions and Answers

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