3.3.3 Bullet Points as Array Values
10 Computer Science · Chapter 3: Programing Fundamentals · Federal Board (FBISE)
3.3.3 Bullet Points as Array Values from Federal Board 10 Computer Science (10th Class) Chapter 3, Programing Fundamentals: 3 MCQs with answers.
Bullet Points as Array Values MCQs
- Q1
In a dynamic bullet-point list built from a JavaScript array, what happens when an item is added to the array?
Show answer
Correct answer: A. The list on the webpage can be updated to reflect the new item
Since the list is generated from the array's contents, adding an item and calling the update function reflects the change on the webpage.
- Q2
What keyword is used to define a reusable block of code that performs a specific operation in JavaScript?
Show answer
Correct answer: D. function
The 'function' keyword is used to define a function — a reusable block of code for a specific operation.
- Q3
What does setting innerHTML to an empty string do before updating a list?
Show answer
Correct answer: A. Clears existing content before adding new list items
Setting innerHTML to an empty string clears existing content so the list can be rebuilt without duplicating old items.