Closed Nalini1998 closed 1 year ago
What problem is caused by this code block?
for (let i = 10; i > 0; i++) { console.log(i); };
A. You can’t run a loop without an array.
B. The code won’t run because the stop condition is less than the start condition.
C. i = 10 and i > 0 should be switched.
D. The code will loop forever because i will always be greater than 0.
I chose D. The code will loop forever because i will always be greater than 0.
What problem is caused by this code block?
A. You can’t run a loop without an array.
B. The code won’t run because the stop condition is less than the start condition.
C. i = 10 and i > 0 should be switched.
D. The code will loop forever because i will always be greater than 0.