JS
JavaScript Quiz
Test Your JS Knowledge!
Multiple Choice & Fill in the Blanks
___________________________
Name: ____ Score: _______ / 30
___________________________
Section: ____ Date: _______ / _______
Directions: Read each item carefully. For Multiple Choice, circle or write the letter of the best answer.
For Fill in the Blanks, write the correct word or expression on the line provided. Total: 30 points. Good
luck! ■
● PART I — Multiple Choice
Choose the letter of the best answer. Write it on the blank before the number. (1 point each)
1. Which keyword is used to declare a variable that cannot be reassigned?
■ A. var
■ B. let
■ C. const
■ D. static
(1 pt)
2. What will typeof null return in JavaScript?
■ A. "null"
■ B. "undefined"
■ C. "object"
■ D. "boolean"
(1 pt)
3. Which method removes the last element of an array and returns it?
■ A. shift()
■ B. pop()
■ C. splice()
■ D. slice()
(1 pt)
4. What does the === operator check?
■ A. Value only
■ B. Type only
■ C. Value and type
■ D. Neither value nor type
(1 pt)
5. Which of the following is NOT a JavaScript data type?
■ A. String
■ B. Boolean
■ C. Float
■ D. Symbol
(1 pt)
6. What will [Link](0.1 + 0.2 === 0.3) output?
■ A. true
■ B. false
■ C. NaN
■ D. undefined
(1 pt)
7. Which built-in method converts a JSON string to a JavaScript object?
■ A. [Link]()
■ B. [Link]()
■ C. [Link]()
■ D. [Link]()
(1 pt)
8. What is the output of [Link](typeof [])?
■ A. "array"
■ B. "null"
■ C. "object"
■ D. "undefined"
(1 pt)
9. Which loop is guaranteed to execute its body at least once?
■ A. for
■ B. while
■ C. do...while
■ D. for...of
(1 pt)
10. What does the spread operator (...) do?
■ A. Deletes array elements
■ B. Expands an iterable into individual elements
■ C. Compresses an array
■ D. Filters an array
(1 pt)
11. Which method is used to add one or more elements to the end of an array?
■ A. unshift()
■ B. push()
■ C. concat()
■ D. append()
(1 pt)
12. What is a closure in JavaScript?
■ A. A syntax error
■ B. A function with access to its outer scope even after the outer function returns
■ C. A method to close browser tabs
■ D. An object that blocks code execution
(1 pt)
13. Which of the following creates a Promise that is immediately resolved?
■ A. [Link](value)
■ B. new Promise()
■ C. [Link](value)
■ D. [Link]()
(1 pt)
14. What is the purpose of the async/await keywords?
■ A. To create synchronous loops
■ B. To handle asynchronous code in a synchronous style
■ C. To define arrow functions
■ D. To export modules
(1 pt)
15. What does NaN stand for?
■ A. Null and Nothing
■ B. Not a Node
■ C. Not a Number
■ D. New and Null
(1 pt)
16. Which statement correctly defines an arrow function?
■ A. function() => {}
■ B. () => {}
■ C. => function() {}
■ D. function => () {}
(1 pt)
17. What does [Link]() return?
■ A. The original array
■ B. A new array with transformed elements
■ C. A boolean
■ D. undefined
(1 pt)
18. Which event is fired when the DOM is fully loaded?
■ A. [Link]
■ B. DOMContentLoaded
■ C. [Link]
■ D. pageLoad
(1 pt)
19. What is the default value of an uninitialized variable declared with let?
■ A. null
■ B. 0
■ C. undefined
■ D. false
(1 pt)
20. Which method is used to select an HTML element by its ID?
■ A. [Link]()
■ B. [Link]()
■ C. [Link]()
■ D. [Link]()
(1 pt)
✏ PART II — Fill in the Blanks
Complete each statement by writing the correct word, keyword, or expression on the blank. (1 point each)
Word Bank: hoisting · prototype · event loop · callback · falsy · NaN · DOM · undefined · this · destructuring
21. JavaScript is a single-threaded language. It uses the __________________ to manage asynchronous
operations without blocking the main thread.
(1 pt)
22. A value that evaluates to false in a boolean context (e.g., 0, "", null) is called a __________________
value.
(1 pt)
23. The keyword __________________ refers to the object that owns the currently executing function.
(1 pt)
24. In JavaScript, __________________ is the behavior where variable and function declarations are
moved to the top of their containing scope before code execution.
(1 pt)
25. The Document Object Model is also known as the __________________, which represents the HTML
structure of a web page as a tree of objects.
(1 pt)
26. A function passed as an argument to another function and executed later is called a
__________________.
(1 pt)
27. When you try to access a property that does not exist on an object, JavaScript returns
__________________.
(1 pt)
28. Every JavaScript object has a hidden property called __proto__ that links it to another object known as
its __________________.
(1 pt)
29. The result of any arithmetic operation involving an invalid number, such as parseInt("hello"), returns
__________________.
(1 pt)
30. The ES6 syntax that allows you to unpack values from arrays or properties from objects into distinct
variables is called __________________.
(1 pt)
— End of Quiz — | Total: 30 Points | Prepared with ❤ using Python & ReportLab