+ 1
Break in loop JavaScript
Does br mean break in the loop?
4 ответов
+ 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