Javascript order evaluation

Went through this piece of JS, and I honestly have no idea what things are being evaluated in ... Any ideas? Brackets will be useful ...

return point[0] >= -width / 2 - allowance && point[0] <= width / 2 + allowance && point[1] >= -height / 2 - allowance && point[1] <= height / 2 + allowance; 
+6
javascript order-of-evaluation
source share
5 answers

Equivalent:

 return (point[0] >= ((-width / 2) - allowance)) && (point[0] <= (( width / 2) + allowance)) && (point[1] >= ((-height / 2) - allowance)) && (point[1] <= (( height / 2) + allowance)); 
+2
source share

https://developer.mozilla.org/en/JavaScript/Reference/Operators/Operator_Precedence

Relavant operators are in the following order: unitary 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)) 
+2
source share

check this

 function bob(n){ alert(n); return n; } return bob(1) >= bob(2) / bob(3) - bob(4) && bob(5) <= bob(6) / bob97) + bob(8) && bob(9) >= bob(10) / bob(11) - bob(12) && bob(13) <= bob(14) / bob(15) + bob(16); 
+2
source share

Adding paradoxes and some indentation should be clearer:

 return point[0] >= (-width / 2) - allowance && point[0] <= (width / 2) + allowance && point[1] >= (-height / 2) - allowance && point[1] <= (height / 2) + allowance; 
0
source share

return (point[0]) >= (-width / 2 - allowance) && (point[0] <= width / 2 + allowance) && (point[1] >= -height / 2 - allowance) && (point[1]) <= (height / 2 + allowance);

0
source share

All Articles