Javascript评估顺序

wha*_*gon 6 javascript operator-precedence

遇到这个JS片段,我真的不知道正在评估什么样的订单......有什么想法吗?括号会有帮助...

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

Mat*_*Mat 2

相当于:

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