A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/statements/Labeled below:

Labeled ยท WebPlatform Docs

Labeled Summary

Provides an identifier for a statement.

Syntax
label :
statements
label
Required. A unique identifier used when referring to the labeled statement.
statements
Optional. One or more statements associated with label.
Examples

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.

Outer:
 for (i = 1; i <= 10; i++) {
    document.write ("<br />");
    document.write ("i: " + i);
    document.write (" j: ");

 Inner:
    for (j = 21; j <= 30; j++) {
       if (j == 24)
           {
           continue Inner;
       }
       document.write (j + " ");
   }
 }
Remarks

Labels are used by the break and continue statements to specify the statement to which the break and continue apply.

See also Other articles Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4