About the logical operators in 5, you should always be aware of their defined behavior:
a && b yields b if a is truthy, otherwise false
a || b yields the first value of a, b that is truthy
This means that a || b && c will return a if it a is truthy. If you are using a tool like prettier, you can just use brackets everywhere and let it figure out where they can be removed safely.
About the logical operators in 5, you should always be aware of their defined behavior:
a && b
yields b if a is truthy, otherwisefalse
a || b
yields the first value of a, b that is truthyThis means that
a || b && c
will return a if it a is truthy. If you are using a tool like prettier, you can just use brackets everywhere and let it figure out where they can be removed safely.I second that @lexlohr ! Nice suggestion to keep in mind.