JavaScript | Control Flow | Question 4

Last Updated :
Discuss
Comments

What will the following code output?

JavaScript
for (let i = 0; i < 3; i++) {
    if (i === 1) break;
    console.log(i);
}


0, 1, 2

0

1

0, 1

Share your thoughts in the comments