• subignition@fedia.io
    link
    fedilink
    arrow-up
    8
    ·
    2 days 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);