09.02.2015, 03:31
For the record, something which no one specified: you can use continue to "break" a loop on the current iteration and continue on the next one.
If in your prime example you used continue instead of break it would've done what you had intended; however, the loop will still run even after you find your value, so for efficency you use break once you find the value so it doesn't run anymore.
If in your prime example you used continue instead of break it would've done what you had intended; however, the loop will still run even after you find your value, so for efficency you use break once you find the value so it doesn't run anymore.