1. In a 'for' loop, what does the initialization statement typically do? Defines the loop condition Executes the loop body Initializes the loop variable Indicates the end of the loop Wrong 2. How is a 'while' loop different from a 'do-while' loop? 'while' checks the condition before the loop body, 'do-while' checks after 'while' is used for finite loops, 'do-while' for infinite loops 'do-while' does not exist in JavaScript 'while' and 'do-while' are interchangeable Wrong 3. What is the result of the following code: 'for (let i = 0; i < 5; i++) { console.log(i); }' 0, 1, 2, 3, 4 1, 2, 3, 4, 5 5, 4, 3, 2, 1 0, 1, 2, 3, 4, 5 Wrong 4. What is the purpose of the 'continue' statement in a loop? Jumps to the next iteration of the loop Exits the loop prematurely Skips the current iteration Creates an infinite loop Wrong 5. Which loop is suitable when the number of iterations is known beforehand? for while do-while if Wrong 6. How do you create an infinite loop intentionally in JavaScript? Using 'for' loop with no condition Using 'while' loop with no condition It is not possible to create an infinite loop intentionally By using the 'break' statement Wrong 7. In a 'for' loop, where should the loop variable be declared? Outside the loop Inside the loop body It is not necessary to declare the loop variable Before the initialization statement Wrong 8. What does the 'break' statement do in the context of loops? Jumps to the next iteration of the loop Exits the loop prematurely Creates an infinite loop Skips the current iteration Wrong 9. Which loop is best suited when you want the loop body to execute at least once? for while do-while if Wrong 10. What is the primary purpose of using loops in JavaScript? To declare variables To control the program flow based on conditions To perform repetitive tasks efficiently To handle errors Wrong Result: Share on Facebook