you are viewing a single comment's thread
view the rest of the comments
[–] 8 points 1 year ago

this is way more nested ternary operators than I would ever use (which I understand is for the sake of example) but if you rearrange them so that the simplest statements are in the true branches, and use indentation, you can make it at least a little more readable

a = a <= b ? 
    (b < c ? a : d)
    : b <= c ?
        d
        : (a < d ? c : a);
  • source
  • parent