In expressions involving the logical operators and (&&) and or (||), code will execute faster if you use a feature called short circuit evaluation. When the scripting engine evaluates a logical expression, it only evaluates as many sub-expressions as required to get a result.
The logical and (&&) operator evaluates the left expression passed to it first. If that expression converts to false, then the result of the logical and operator cannot be true regardless of the value of the right expression. Therefore, the right expression is not evaluated.
Similarly, the logical or operator (||) evaluates the left expression first and if it converts to true, the right expression is not evaluated.
So to make a script run most efficiently, place the conditions most likely to be true first for the logical or operator. For the logical and operator, place the conditions most likely to be false first.
This is particularly helpful in expressions involving function calls.