JavaScript Functions: book back answers
10 solved questions from the end of this chapter, Class 11 Computer Applications, Tamil Nadu State Board. Each answer is checked against the textbook, and you can open the page that proves it.
← Notes and quiz for JavaScript FunctionsPart-I Choose the correct answer
The parameters work as
- A) Local variable
- B) Global Variable
- C) File variable
- D) block variable
Try it, then show the answerAnswer
A) Local variable
Parameters work as local variables for the body of the function.
From the book: “parameters that work as local variables for the body of the function”
Predefined functions are also called as
- A)Library functions
- B) storage functions
- C) instructions
- D) commands
Try it, then show the answerAnswer
A)Library functions
Pre-defined functions are already defined in the JavaScript library and are also called Library functions.
From the book: “which are also called Library functions”
Larger programs are divided into smaller are called
- A) modules
- B) block
- C) sets
- D) Group
Try it, then show the answerAnswer
A) modules
The chapter says large programs are divided into small programs called modules.
From the book: “such large programs are divided into small programs are called modules”
Which of the following is used to enhance reusability and program clarity.
- A) functions
- B) modules
- C) sets
- D) instructions
Try it, then show the answerAnswer
A) functions
Functions keep code for a particular job in one place, enhancing reusability and program clarity.
From the book: “in one place in order to enhance reusability and program clarity”
Which of the following allow the programmer to modu/arize a program
- A) Library functions
- B) user defined functions
- C) Normal functions
- D) Ordinary functions
Try it, then show the answerAnswer
B) user defined functions
User-defined functions allow the programmer to modularize a program.
From the book: “User-defined functions allow the programmer to modularize a program.”
Part – II Very Short Answers
What is a function in JavaScript?
Try it, then show the answerAnswer
A function is a block of JavaScript code that is defined once but may be executed or invoked any number of times.
A function groups code that performs a specific task and can be invoked repeatedly.
From the book: “A function is a block of JavaScript code that is defined once”
What is the use of function?
Try it, then show the answerAnswer
Functions encapsulate code that performs a specific task, avoid repetition, and enhance reusability and program clarity.
Keeping code for a particular job in one place makes it reusable and avoids typing the same statements repeatedly.
From the book: “they are used to keep code that performs a particular job in one place”
Write a note on Library functions.
Try it, then show the answerAnswer
Library functions are predefined functions already defined in the JavaScript library. Examples include isNaN(), toUpperCase(), toLowerCase(), alert(), and prompt().
They are ready-made functions provided by the JavaScript library for commonly required tasks.
From the book: “Pre-defined functions are already defined in the JavaScript library”
Write a note on user defined functions.
Try it, then show the answerAnswer
User-defined functions are created by the programmer and allow a program to be modularized into smaller parts.
The chapter explains that large programs are divided into smaller programs called modules, and user-defined functions support this modularization.
From the book: “User-defined functions allow the programmer to modularize a program.”
Write the syntax of functions.
Try it, then show the answerAnswer
function function-name(parameters list) { Declaration of variable Executable statements; }
A function definition uses the function keyword, a name and parameter list, followed by a body enclosed in braces.
From the book: “The function body must be enclosed by braces.”