I have the code below :
LableName_1:
if(ttipPos == 'left') {
//do sumthing
break L;
}
LableName_2:
if(ttipPos == 'right') {
//do sumthing
break LableName_1;
}
where I used break with label name
This is showing syntax error, but if I replace break LableName_1 with break LableName_2 within second if statement, the syntax error doesn't occur .... Is there any problem related to scope of using break with label.
breakis a keyword in JavaScript. what are you trying to do?breakwith if-statements