for (i = 0; i < 5; i++) { // code }
for (i <= 5; i++) { // code }
for i = 1 to 5 { // code }
for (i = 0; i < 5) { // code }
for loop
while loop
do-while loop
None of the above
break statement stops the loop, and continue skips the current iteration
continue statement stops the loop, and break skips the current iteration
Both break and continue stop the loop
Both break and continue skip the current iteration
foreach loop
Yes, but only two levels deep
No, nesting loops is not allowed
Yes, we can nest any number of loops
Yes, but only with for loops
How many times will the following loop execute How many times will the following loop execute?
for (let i = 0; i < 5; i++) { console.log(i); }
4
5
6
Infinite
What will be the output of the following JavaScript code?
let i = 0;while(i < 3) { console.log(i); i++;}
0 1 2
1 2 3
0 1 2 3
1 2