Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 5 lesson 5(break statement) of javascript course

code written is right,getting a right output but still getting an error saying check out the condition in if(). Did not get the hint from help section.Please look into it,I'm stuck here.
by

1 Answer

iamabhishek
This should work:

let x = 0;

while(x < 10)
{
console.log(x);
if(x == 5) {
break;
}
x++;
}

Login / Signup to Answer the Question.