🟨

JavaScript MCQ

Test your JavaScript knowledge with 100 multiple choice questions covering fundamentals to advanced concepts, with instant feedback and explanations.

100 Questions 40 Beginner 40 Intermediate 20 Advanced
1

Which keyword declares a block-scoped variable in modern JavaScript?

2

What does typeof null return in JavaScript?

3

What is the output of 0.1 + 0.2 === 0.3 in JavaScript?

4

What does === check in JavaScript?

5

What is a closure in JavaScript?

6

What does the spread operator ... do?

7

What is event bubbling?

8

What does Array.prototype.map() return?

9

What is hoisting in JavaScript?

10

What is the Temporal Dead Zone (TDZ)?

11

What is a Promise in JavaScript?

12

What is the difference between null and undefined?

13

What does Array.prototype.filter() return?

14

What is the this keyword in a regular function vs arrow function?

15

What does JSON.stringify() do?

16

What is the prototype chain?

17

What does the Array.prototype.reduce() method do?

18

What is an Immediately Invoked Function Expression (IIFE)?

19

What is event.preventDefault() used for?

20

What is NaN in JavaScript?

21

What does the typeof operator return for a function?

22

What is destructuring in JavaScript?

23

What does Array.prototype.find() return?

24

What is the difference between for...of and for...in?

25

What is a template literal?

26

What does the optional chaining operator ?. do?

27

What is the difference between == and ===?

28

What does Object.keys() return?

29

What is a Set in JavaScript?

30

What is a Map in JavaScript?

31

What does async/await do?

32

What does Array.isArray() do?

33

What is the ternary operator?

34

What is the difference between let, const, and var?

35

What does String.prototype.split() return?

36

What is the purpose of the new keyword?

37

What is the event loop?

38

What does Object.assign() do?

39

What is a Symbol in JavaScript?

40

What does Array.prototype.some() return?

1

What is the difference between microtasks and macrotasks?

2

What is the WeakMap?

3

What is a generator function?

4

What is currying in JavaScript?

5

What does Object.freeze() do?

6

What is the difference between call(), apply(), and bind()?

7

What is prototype-based inheritance in JavaScript?

8

What is memoization?

9

What are Proxy and Reflect in ES6?

10

What is the difference between shallow and deep copy in JavaScript?

11

What does Promise.all() do?

12

What is the difference between Promise.race() and Promise.any()?

13

What is the module pattern in JavaScript?

14

What is a Symbol.iterator used for?

15

What does structuredClone() do?

16

What is the purpose of WeakRef?

17

What is the Nullish Coalescing operator ??

18

What is the difference between Object.create(null) and {}?

19

What is tagged template literals?

20

What is the purpose of FinalizationRegistry?

21

What is the difference between Array.prototype.forEach() and for...of?

22

What is the difference between Array.from() and Array.of()?

23

What is async iteration (for await...of)?

24

What is the purpose of Object.entries() and how is it commonly used?

25

What is a JavaScript Proxy handler's set trap used for?

26

What is the difference between Object.keys() and Reflect.ownKeys()?

27

What is a JavaScript realm and its security implication?

28

What is the Error.cause property (ES2022)?

29

What is logical assignment (&&=, ||=, ??=) in JavaScript?

30

What is Array.prototype.at() and why was it added?

31

What is the hasOwn() method (ES2022)?

32

What is the structuredClone() limitation with functions?

33

What is the difference between Symbol.toPrimitive and valueOf?

34

What is the temporal proposal (TC39 Stage 3) for JavaScript date handling?

35

What is Promise.withResolvers() (ES2024)?

36

What is the iterator helpers proposal (Stage 3) in JavaScript?

37

What is the Object.groupBy() method (ES2024)?

38

What is the RegExp v flag (ES2024)?

39

What is the TC39 decorators proposal (Stage 3)?

40

What is the difference between Array.prototype.flatMap() and map().flat()?