+ 1
Break in loop JavaScript
Does br mean break in the loop?
4 Answers
+ 5
Your question is confusing a bit.
"Br" and "Break" are different things.
<br> tag is used in HTML to put a line break.
And Break is used in programming languages to break loops unconditional or conditionally.
For example :
var i = 0;
while(true){
if (i > 10){
break;
}
}
In above example, i is initialized with 0 and while loop will run forever because condition is given true, now inside loop it will check if i is greater than 10, if it is then it will stop the loop running.
+ 2
victor, you're welcome!
+ 1
TheĀ breakĀ statement exits a switch statement or aĀ loopĀ (for, for ... in, while,doĀ ... while). When theĀ breakstatementĀ isĀ used in aĀ loop, itĀ breakstheĀ loopĀ and continues executing the code after theĀ loopĀ (if any).
+ 1
thx