Continue statement
Skip the rest of one turn and carry on with the next value.
Simple example
Skip two.
Start1 → 3 · skip 2
Result1
3
function main()
for number in 1:3
if number == 2
continue
end
println(number)
end
end
main()
1 3
Advertisements
Everyday examples
Locker 12 is being repaired. List the available lockers from 11 through 13.
Start11 → 13 · skip 12
Result11
13
function main()
for locker in 11:13
if locker == 12
continue
end
println(locker)
end
end
main()
11 13