The continue statement

Loops are based on expressions. The logic of the expression decides the continuity of the loop. However, there are times when you are in between loop execution and would like to go back to the first line of code  without executing the rest of the code for the next iteration. The continue statement helps us do that.

In the following screenshot, the for loop is executed till the end; however the values after 5 are not logged at all:

Get Solidity Programming Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.