Matt Uy wrote:
I was just practicing some logical operators and came up with this code snippet. I'm just trying to understand more about logical operators with its precedence and short circuit along with the unary operators all combined. I tried looking for a same code snippet in the internet but could not find any.
I have a little knowledge about the unary operators, short circuit and precedence of logical operators but I would really appreciate for some explanation on what was evaluated, where the short circuit happened and other things here in the code.
There are way too many thing going on in this example for it to be useful, IMO.
How about this? Why don't you tell us what you know about each concept, and we can get you up to speed on the components first, before we put everything together.
For example, what do you think is the precedence and only the precedence? And not worry about associative, order of evaluation, the unary pre/postfix operators, or the short circuit of the logic operators yet. Once you get that right, we can move on.
Henry