Break & continue
To control the flow of a loop, we have two keywords break and continue.
Break
Break is used to terminate the loop.
Syntax
break
Examples
Breaking down an infinite loop
Continue
Continue is used to continue the loop contidion.
Syntax
continue
Examples
Last updated
Was this helpful?