Activity 4

1. How to run array-related operations efficiently?

2. What is the condition part in a for loop?

3. How to loop over converted object keys?

4. Which loop conditionally executes a block?

5. What is the output for even numbers 0-10?

6. How do you combine arrays with loops?

7. What is the for-in loop used for?

8. What is a key feature of a do-while loop?

9. What are the components of a for loop?

10. What happens in a do-while with false conditions?

Correct Answers

1. How to run array-related operations efficiently? ✅ Use loops like for or while in combination with methods.

2. What is the condition part in a for loop? ✅ It determines when the loop stops.

3. How to loop over converted object keys? ✅ Convert keys to arrays, then use loops.

4. Which loop conditionally executes a block? ✅ While loop

5. What is the output for even numbers 0-10? ✅ "0, 2, 4, 6, 8, 10"

6. How do you combine arrays with loops? ✅ Use the length property with a loop condition.

7. What is the for-in loop used for? ✅ Iterating over object properties.

8. What is a key feature of a do-while loop? ✅ It runs the code block at least once before checking.

9. What are the components of a for loop? ✅ Initialization, condition, increment/decrement.

10. What happens in a do-while with false conditions? ✅ The block runs once before stopping.

Instructions:

Set Up Your Development Environment

Implement JavaScript Loops

Document

Javascript Loops