This documentation is archived and is not being maintained.
Labeled Statement
Visual Studio 2008
Updated: July 2009
Provides an identifier for a statement.
label : [statements]
In the following code, the continue statement refers to the for loop that is preceded by the Inner: statement. When j is 24, the continue statement causes that for loop to go to the next iteration. The numbers 21 through 23 and 25 through 30 print on each line.
var s = "";
Outer:
for (var i = 1; i <= 10; i++)
{
s += "\n";
s += "i: " + i;
s += " j: ";
Inner:
for (var j = 21; j <= 30; j++)
{
if (j == 24)
{
continue Inner;
}
s += j + " ";
}
}
print (s);
Show: