Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

label

The label statement is used to prefix an identifying label to a statement for use with break and continue statements.

Syntaxlabel_name: // statement
loop_A: for( var i = 0; i < 5; i++ ){ document.write("loop A pass: "+i+"<br>"); loop_B: for( var j = 0; j < 5; j++ ){ document.write("loop B pass: "+j+"<br>"); if(j > 1){ break loop_A; } } }

JavaScript

Statements

breakconstcontinuedo whileforfor inif elselabelreturnswitchtry catchvarwhilewith