Control Flow Statements

Continue, Break statements


Syntax

Continue Statement

Skips the current iteration of a loop and continues with the next iteration.

continue

Example:

var a = 0
while a < 10{
    if a == 5 {
        continue
    }
    print(string(a))
}
// 0 1 2 3 4 6 7 9

Break Statement

Terminates the loop statement and transfers control to the statement immediately following the loop.

break

Example:

var a = 0
while a < 10{
    if a == 5{
        break
    }
    print(string(a))
}
// 0 1 2 3 4

    Theme

    Presets

    Background

    Custom:

    Primary

    Custom:

    Secondary

    Custom:

    Border

    Custom:

    Mode

    Light
    Dark