In this case, and evalutes 'a' , which is true, then 'b' , which is true, and returns 'b' . If any value is false in a boolean context, and returns the first false value. In this case, '' is the first false value.
All values are true, so and returns the last value, 'c' .
If any value is true, or returns that value immediately. In this case, 'a' is the first true value. Note that or only evaluates values until it finds one that is true in a boolean context, and then it ignores the rest. This distinction is important if some values can have side effects. Here, the function sidefx is never called, because or evaluates 'a' , which is true, and returns 'a' immediately.