7.5 The continue Statement
The continue statement causes all remaining code statements in a loop to be skipped, and execution to be returned to the top of the loop. In the following example, the print function is only called when the value of variable i is an even number:
var i = 1
while i < 20
{
i += 1
if (i % 2) != 0 {
continue
}
print("i = \(i)")
}
The continue statement in the above example will cause the print call to be skipped unless the value of i can be divided by 2 with no remainder. If the continue statement is triggered, execution will skip to the top of the while loop and the statements in the body of the loop will be repeated (until the...