Page 276 - Web_Application_v2.0_C12_Fb
P. 276
4. The replaceAll() method is used to:
i. Replace only the first occurrence of a string ii. Replace all occurrences of a string
iii. Remove a substring from a string iv. Add a string at the end
5. What will be the output of the following code?
document.write("JavaScript".charAt(4));
i. S ii. r
iii. c iv. J
6. What does Math.floor(4.9) return?
i. 4 ii. 5
iii. 4.9 iv. 0
7. What will be the output of the following JavaScript code?
document.write(["Apple", "Banana", "Cherry"].toString())
i. Apple Banana Cherry ii. ["Apple", "Banana", "Cherry"]
iii. Apple,Banana,Cherry iv. ["Apple Banana Cherry"]
8. Which of the following is NOT a valid event in JavaScript?
i. onclick ii. onload
iii. onexecute iv. onmouseover
9. Which of these is an advantage of JavaScript? [CBSE Handbook]
i. It can be used for client-side and server-side development, i.e., frontend and backend.
ii. It runs on multiple platforms and devices.
iii. It is supported by all browsers.
iv. All of the above
10. Which of these is not a primitive data type in JavaScript? [CBSE Handbook]
i. Boolean ii. Undefined
iii. Array iv. String
B. Fill in the blanks.
1. ............................... in-built function tells the datatype of a variable.
2. ............................... are used to explain the code and make it more readable in JavaScript programs.
[CBSE Term 2 Sample Paper 2022]
3. A JavaScript function can accept another function as a ................................
4. The method used to remove the first element from an array is ................................
5. The replace() method is used to ............................... and ............................... a specified substring within a string.
6. The ............................... method in JavaScript is used to convert a string to lowercase.
7. The ............................... event is triggered when the user moves the mouse over an element.
8. ............................... are the actual values passed to a function when it is invoked.
9. A function to take user input as string is ................................ [CBSE Handbook ]
10. The function used to convert to an integer is ................................ [CBSE Handbook ]
C. State whether the following statements are true or false.
1. The object types in JavaScript are specified by their properties and methods. .....................
2. The function keyword in JavaScript causes the function to terminate. .....................
3. Events are a component of the Document Object Model (DOM) Level 3 and are present
in only a few HTML elements. .....................
4. The Math.max() method returns the highest number in a given list of numbers. .....................
5. The delete keyword can be used to remove elements from an array. .....................
274 Touchpad Web Applications (Ver. 2.0)-XII

