📝 CSE326 Unit-4 MCQ Test

⏱️
30:00

⚡ Each correct answer carries +1 mark and each wrong answer carries -0.25 negative marking.

Question 1

Which keyword is used to declare a variable with block scope in JavaScript?

Question 2

Which JavaScript keyword is used to declare a constant variable?

Question 3

What is the correct syntax to define a function in JavaScript?

Question 4

Which statement is used to return a value from a function?

Question 5

How do you call a function named myFunction in JavaScript?

Question 6

Which JavaScript event occurs when a button is clicked?

Question 7

Which event is triggered when a page finishes loading?

Question 8

Which JavaScript dialog box is used to show a warning message?

Question 9

Which dialog box returns true or false based on user action?

Question 10

Which dialog box is used to take input from the user?

Question 11

Which JavaScript operator is used to compare both value and type?

Question 12

Which loop executes at least once even if the condition is false?

Question 13

Which JavaScript statement is used to stop a loop?

Question 14

Which keyword is used to skip the current iteration of a loop?

Question 15

What will typeof null return in JavaScript?

Question 16

Which event is triggered when the user submits a form?

Question 17

Which method is used to convert a string to an integer?

Question 18

Which symbol is used for single-line comments in JavaScript?

Question 19

Which JavaScript object is used to work with dates?

Question 20

Which function is used to check whether a value is NaN?

Question 21

Which keyword is used to define a JavaScript function parameter?

Question 22

What is the default return value of a JavaScript function if no return statement is used?

Question 23

Which event occurs when an input field loses focus?

Question 24

Which event is triggered when the value of an input field changes?

Question 25

Which JavaScript method is used to access an HTML element by its ID?

Question 26

Which object is the top-level object in JavaScript?

Question 27

Which JavaScript function converts a string to a floating-point number?

Question 28

Which symbol is used to create an object in JavaScript?

Question 29

Which method displays a message and waits for user input?

Question 30

Which JavaScript keyword is used to handle exceptions?