Yes. Any kind of statement may have a label. They look like this:
The
label part must be a valid identifier, but it does not share namespace with any other type of identifier. Thus, you may have a label and a variable with the same name. The JavaScript engine will know when you are using the variable and when you are using the label.
The break statement looks like either of these:
Code:
break;
break label;
The first one can only be used in loops, and will abruptly terminate the directly enclosing loop or switch statement. The second one may be used inside the label statement with specified label, and will abruptly terminate the statement.