Stop a For IF loop when a specific condition is met
For performance reasons it makes sense to stop a ‘for if’ loop running if it has provided the required outcome.e.g. in this example we want to write the value of ‘i’ to the console when it is less than 5. Without the break statement the loop would write the values 0,1,2,3,4 to the console, but […]
Stop a For IF loop when a specific condition is met Read More »
