I have the following code. I feel like I’m being redundant but don’t know how to condense these statements into one.
What’s the right syntax / most efficient + readable way to write multiple conditional statements like this?
if(coorx < 440 && n < 4) {
continue;
}
if(coorx < 280 && n < 5) {
continue;
}
if(coorx < 180 && n < 6) {
continue;
}
Since the same code is executed regardless of which
ifstatement is executed, you can condense all those conditions into oneifconditional using the Javascript OR operator (||):