Imagine you have a set number of values stored in an array and you want to determine if any of them fall above a certain threshold while also being below another limit. How would you achieve this?
Provide a solution without resorting to using a for loop or writing extensive code.
Perhaps something along the lines of:
var havingParty = false;
if ((theArrayWithValuesIn > 10) && (theArrayWithValuesIn < 100)) {
havingParty = true;
} else {
havingParty = false;
}
This method should suffice.
Note: Consider variables x
and y
, detecting collisions, and keeping your code concise.