I have 2 nested loops that look like this:
for (var i = 0; i < SomeArray.length; i++) {
for (var prop in SomeArray[i]) {
if (SomeCondition) {
break; // here I need to break from the outer for-loop
}
}
}
The break statement exits the for-in loop from the object's property but I want to exit the outer for loop.
How do I do that? I thought of setting the value of i to be equal to the length of the outer loop's array but I'm wondering if there's a better way.
Thanks.