Easy way to understand nested ternary operators?
问题 Is there a simple heuristic for understanding how to read nested ternary operators? I came across this in someone's source code and can't grok it. A simple ternary is easy: isRed = color == 'red' ? true : false But how do you read the following? Can I just line up the first with the last and the second with the second to last, or must I parse this into an if/else tree in my head? var offset = ( hasFrozenRows ) ? ( options.frozenBottom ) ? ( row >= actualFrozenRow ) ? ( h < viewportTopH ) ? (