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

Javascript leve 5 lesson5

please what is wrong with this code :
let x = 0;
while(x < 10)
{
console.log(x);
if(x<5){
x++;
}
else {
break;
}
}
by

1 Answer

kshitijrana14
Try this one

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

Login / Signup to Answer the Question.