Came across this JS snippet, and I honestly have NO idea of what order things are being evaluated in... Any ideas? Parentheses would be helpful...
return point[0] >= -width / 2 - allowance &&
point[0] <= width / 2 + allowance &&
point[1] >= -height / 2 - allowance &&
point[1] <= height / 2 + allowance;
https://developer.mozilla.org/en/JavaScript/Reference/Operators/Operator_Precedence
The relavant operators go in this order: unary negation, division, addition/subtraction, relational (>=, <=), logical and.
return (point[0] >= ((-width / 2) - allowance))
&& (point[0] <= ((width / 2) + allowance))
&& (point[1] >= ((-height / 2) - allowance))
&& (point[1] <= ((height / 2) + allowance))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With