0% found this document useful (0 votes)
2 views5 pages

Quiz-FSP-I

The document contains a quiz with multiple choice questions focused on JavaScript concepts, including functions, DOM manipulation, and event handling. Each question is linked to specific course outcomes (CO) and program outcomes (PO). The quiz aims to assess understanding and proficiency in JavaScript programming.

Uploaded by

Karthikeyini S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Quiz-FSP-I

The document contains a quiz with multiple choice questions focused on JavaScript concepts, including functions, DOM manipulation, and event handling. Each question is linked to specific course outcomes (CO) and program outcomes (PO). The quiz aims to assess understanding and proficiency in JavaScript programming.

Uploaded by

Karthikeyini S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Quiz-I

Part A: Multiple Choice Questions (1 mark each)

1. What will document.write("Hello World"); do in JavaScript?


o (a) Print Hello World in console
o (b) Display Hello World on the web page
o (c) Show Hello World in an alert box
o (d) None of the above
CO1 → PO1, PO2
2. Which method is used to take user input via a prompt dialog in JavaScript?
o (a) window.alert()
o (b) document.prompt()
o (c) window.prompt()
o (d) input()
CO1 → PO2, PO3
3. What is the correct way to declare a global variable in JavaScript?
o (a) Use var outside a function
o (b) Use let inside a block
o (c) Use const inside a function
o (d) Declare a variable without var, let, or const
CO2 → PO1, PO3
4. Which operator is used for logical AND in JavaScript?
o (a) &
o (b) &&
o (c) |
o (d) ||
CO2 → PO2, PO4
5. What will be the output of Math.floor(4.7);?
o (a) 4.7
o (b) 5
o (c) 4
o (d) 5.0
CO3 → PO3, PO5
6. Which statement is used to exit a loop prematurely in JavaScript?
o (a) continue
o (b) break
o (c) exit
o (d) stop
CO2 → PO1, PO3
7. What will be the output of console.log("5" + 2);?
o (a) 7
o (b) 52
o (c) 5+2
o (d) Error
CO2 → PO2, PO3
8. Which looping statement executes at least once regardless of the condition?
o (a) for
o (b) while
o (c) do...while
o (d) switch
CO4 → PO3, PO4
9. What does document.getElementById("demo") do?
o (a) Selects an element by class name
o (b) Selects an element by tag name
o (c) Selects an element by ID
o (d) Creates a new element
CO4 → PO4, PO5
10. What is event bubbling in JavaScript?

 (a) Events propagate from child to parent elements


 (b) Events propagate from parent to child elements
 (c) Events do not propagate
 (d) Events are handled asynchronously
CO3 → PO3, PO4

11. What is the purpose of the return statement in a function?

 (a) Exit the function and return a value


 (b) Print a value to the console
 (c) Restart the function execution
 (d) Declare a function parameter
CO3 → PO2, PO3

12. How do you access the last element of an array in JavaScript?

 (a) arr[arr.length]
 (b) arr[arr.length - 1]
 (c) arr[-1]
 (d) arr[0]
CO3 → PO3, PO5

13. Which object is used to perform mathematical operations in JavaScript?

 (a) Math
 (b) Number
 (c) Calc
 (d) Arithmetic
CO3 → PO3, PO5

14. What does new Date() return?

 (a) A string representation of the date


 (b) The current date and time
 (c) The number of milliseconds since 1970
 (d) Undefined
CO3 → PO3, PO4

15. Which method is used to add an event listener to an element?

 (a) onClick()
 (b) addEvent()
 (c) addEventListener()
 (d) listenEvent()
CO5 → PO4, PO5

16. What happens when continue is used in a loop?

 (a) It stops the loop execution


 (b) It skips the current iteration and proceeds to the next iteration
 (c) It restarts the loop
 (d) It exits the loop
CO2 → PO2, PO3

17. What event fires when a webpage is fully loaded?

 (a) onload
 (b) DOMContentLoaded
 (c) readyState
 (d) pageLoad
CO4 → PO4, PO5

18. How do you remove an element from the DOM?

 (a) removeElement()
 (b) deleteNode()
 (c) element.remove()
 (d) removeChild()
CO4 → PO4, PO5

19. What does typeof([]) return in JavaScript?

 (a) array
 (b) object
 (c) list
 (d) undefined
CO3 → PO3, PO5

20. What method is used to convert a JSON string into a JavaScript object?

 (a) JSON.parse()
 (b) JSON.stringify()
 (c) parseJSON()
 (d) convertJSON()
CO3 → PO3, PO5

21. What property is used to prevent the default behavior of an event?

 (a) stopPropagation()
 (b) preventDefault()
 (c) cancelEvent()
 (d) stopEvent()
CO5 → PO4, PO5

22. What method is used to create a new element in the DOM?

 (a) createNode()
 (b) document.createElement()
 (c) newElement()
 (d) addElement()
CO4 → PO4, PO5

23. Which object represents the browser window?

 (a) document
 (b) window
 (c) navigator
 (d) screen
CO4 → PO4, PO5

24. Which event occurs when the user moves the mouse over an element?

 (a) onmouseover
 (b) onmousein
 (c) onmouseenter
 (d) onhover
CO5 → PO4, PO5

25. What is the purpose of the localStorage object?

 CO4 → PO4, PO5


CO-PO Mapping Key:

 CO1: Understand JavaScript Basics


 CO2: Apply Control Statements & Loops
 CO3: Utilize Functions & Objects
 CO4: Work with DOM Manipulation
 CO5: Implement JavaScript Events
 PO1: Problem-solving skills
 PO2: Coding proficiency
 PO3: Analytical thinking
 PO4: Software implementation
 PO5: Web development expertise

You might also like