I am trying to use a where filter like so:
where (a && b) || c
Prettify keeps removing the parenthesis. Doesn’t this mess with the order of operations?
I am trying to use a where filter like so:
where (a && b) || c
Prettify keeps removing the parenthesis. Doesn’t this mess with the order of operations?
This shouldn’t. The logical operations can be treated similar to arithmetic operations, so it is read left to right. The only instance parenthesis is needed is when operations is done outside the left to right order. For example, there is a difference between
A || B && C
vs.
A || (B && C )
For more info on this, please see https://www.cs.utexas.edu/~dnp/frege/logical-operator-precedence.html
Thanks
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.