JavaScript MCQs

JavaScript ES6+, closures, promises, event loop, DOM, and async/await.

23 MCQsProgrammingAll Levels
Key Concept Overview & Exam Context

Review core principles of JavaScript before answering questions. These questions simulate placement technical assessments (TCS, Infosys, Amazon), university exams (CS/IT), and technical certifications.

Target Readiness
Placements & Job Interviews
Question Format
Multiple-Choice with Explanations
Verified Solutions
Step-by-step Output Traces

JavaScript MCQ Questions

Page 1 of 2 (23 total)
Q1

What is the difference between 'let' and 'var' in JavaScript?

medium
Correct Answer: 'let' is block-scoped, while 'var' is function-scoped
Explanation:
A variable declared with 'let' inside a block, such as an if statement or loop, is only accessible within that block, while 'var' ignores block boundaries and is instead scoped to the nearest enclosing function.
Q2

What is a closure in JavaScript?

hard
Q3

What is the difference between '==' and '===' in JavaScript?

easy
Q4

What is 'hoisting' in JavaScript?

hard
Q5

What does the JavaScript 'this' keyword refer to inside a regular function called as a method of an object?

hard
Q6

What is a Promise in JavaScript used for?

medium
Q7

What does the JavaScript array method 'map()' do?

medium
Q8

What is the purpose of the JavaScript 'filter()' array method?

medium
Q9

What is the difference between 'null' and 'undefined' in JavaScript?

medium
Q10

What is the JavaScript event loop responsible for?

hard
Q11

What does an arrow function in JavaScript do differently regarding 'this'?

hard
Q12

What is the purpose of JSON.stringify() in JavaScript?

easy
Q13

What is the reverse operation of JSON.stringify()?

easy
Q14

What does the spread operator (...) allow you to do in JavaScript?

medium
Q15

What is event bubbling in the context of the DOM?

hard
Q16

What is the purpose of the JavaScript 'reduce()' array method?

medium
Q17

What is a template literal in JavaScript?

easy
Q18

What does the 'typeof' operator return when used on a variable that has been declared but never assigned a value?

easy
Q19

What is prototypal inheritance in JavaScript?

hard
Q20

What is the purpose of async/await syntax in JavaScript?

hard
Showing 1 to 20 of 23 questions