How to stop a for loop before it completes it's full cycle?

Hello, I am creating a for loop, that I wish to stop once a given statement is found true. How would I go about doing this?

example:

for(var i in objectArray){

if(i.transform.position.y <= 0){

doSomething = true;
**stop the loop**;

}

else{doSomething = false;}

}

This above code is simili code, just to give an example. In my code, I have many if statements that can override each other, thus I need to stop the loop once a statement is validated.

Use `break`.

for (var i in objectArray) {
    // do stuff
    break;
    // this would do more stuff it a break wasn't there.
}

Note: You made not need the `;` on the end of `break`; this is untested code, and I don't remember if it is necessary.