Pass control to next iteration offor
orwhile
loop
continue
continue
passes control to the next iteration of afor
orwhile
loop. It skips any remaining statements in the body of the loop for the current iteration. The program continues execution from the next iteration.
continue
applies only to the body of the loop where it is called. In nested loops,continue
skips remaining statements only in the body of the loop in which it occurs.
Thecontinue
statement skips the rest of the instructions in afor
orwhile
loop and begins the next iteration. To exit the loop completely, use abreak
statement.
continue
is not defined outside afor
orwhile
loop. To exit a function, usereturn
.