for num in 0...5 {
if num % 2 == 0 {
continue
}
print(num)
}
// print: 1
// print: 3
// print: 5
The continue
keyword will force the loop to continue for the next iteration
Comments
for num in 0...5 {
if num % 2 == 0 {
continue
}
print(num)
}
// print: 1
// print: 3
// print: 5
The continue
keyword will force the loop to continue for the next iteration