> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript Continue Statement

The `continue` statement is a control flow mechanism used within iterative structures (`for`, `while`, `do...while`, `for...in`, `for...of`) to prematurely terminate the current iteration. When encountered, it bypasses all subsequent statements within the loop's block for that specific iteration and immediately transfers control to the loop's next iteration cycle.

## Syntax

The statement can be used in two forms: unlabeled and labeled.

```typescript theme={"dark"}
// Unlabeled
continue;

// Labeled
continue labelIdentifier;
```

## Execution Mechanics

The exact behavior of the control transfer depends on the type of loop enclosing the `continue` statement:

* **`for` loops:** Control jumps directly to the update expression (e.g., `i++`). After the update expression executes, the loop's conditional expression is evaluated to determine if the next iteration should proceed.
* **`while` and `do...while` loops:** Control jumps directly to the boolean condition evaluation. If the condition evaluates to `true`, the loop continues.
* **`for...in` and `for...of` loops:** Control jumps to the next enumerable property or iterable element binding, respectively.

### Unlabeled `continue`

When used without a label, the statement applies exclusively to the innermost enclosing loop.

```typescript theme={"dark"}
for (let i = 0; i < 5; i++) {
    if (i === 2) {
        continue; // Control jumps to i++
    }
    console.log(i); // This statement is skipped when i === 2
}
```

### Labeled `continue`

TypeScript supports labeled statements, which allow you to prefix a loop with an identifier. When `continue` is paired with a label, it bypasses the current iteration of the specific enclosing loop associated with that label, rather than defaulting to the innermost loop.

```typescript theme={"dark"}
outerLoop: for (let i = 0; i < 3; i++) {
    for (let j = 0; j < 3; j++) {
        if (i === 1) {
            continue outerLoop; // Control jumps to i++ of the outer loop
        }
        console.log(`i: ${i}, j: ${j}`);
    }
}
```

## Compiler Constraints

* A `continue` statement must be nested within an iterative statement. Placing it outside of a loop results in a compile-time syntax error (`TS1104: A 'continue' statement can only be used within an enclosing iteration statement`).
* When using the labeled form, the target label must exist on an enclosing iteration statement within the same function boundary. It cannot reference a label outside its lexical scope or a label attached to a non-loop block.

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor TypeScript Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
