Chapter 16: JavaScript Functions — Online MCQ Test
COMPUTER APPLICATIONS · CLASS 11th · Tamil Nadu State Board
Practice Chapter 16: JavaScript Functions with a free chapter-wise online MCQ test.
This chapter covers: This chapter covers function definitions parameter passing return values and built-in JavaScript functions. Students write modular reusable code blocks and handle event-driven scri....
AI-generated questions from basic to board-exam level, with instant results and explanations.
Chapter 16: JavaScript Functions — Important Questions & Answers
What is a JavaScript function?
- A. A block of code designed to perform a particular task
- B. A variable used to store text
- C. A loop that repeats statements
- D. A style rule for web pages
Answer: A. A block of code designed to perform a particular task
A function is a reusable block of code that performs a specific task whenever it is called.
A function is a reusable block of code that performs a specific task whenever it is called.
Which keyword is used to define a function in JavaScript?
- A. define
- B. function
- C. method
- D. call
Answer: B. function
The keyword function is used to declare a function in JavaScript.
The keyword function is used to declare a function in JavaScript.
Which statement correctly calls the function named display()?
- A. display;
- B. call display();
- C. display();
- D. function display();
Answer: C. display();
A function is called by writing its name followed by parentheses, such as display();
A function is called by writing its name followed by parentheses, such as display();
Which of the following is NOT a function in JavaScript?
- A. alert()
- B. confirm()
- C. parseFloat()
- D. console page()
Answer: D. console page()
console page() is not a valid JavaScript built-in function. The others are standard built-in functions.
console page() is not a valid JavaScript built-in function. The others are standard built-in functions.
Which is the best reason to use a function in an event-driven JavaScript program?
- A. To make the browser slower
- B. To run the same code repeatedly when an event occurs
- C. To prevent all user interactions
- D. To replace HTML tags
Answer: B. To run the same code repeatedly when an event occurs
In event-driven programming, functions are used as handlers so that the same task runs whenever an event happens.
In event-driven programming, functions are used as handlers so that the same task runs whenever an event happens.