Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You need to do the same in-head simulation for the standard if, it just feels effortless due to familiarity. Note the author messed up by not using the same logic in the ternary.

    conditionA
      ? conditionB
        ? ‘A + B’
        : ‘A’
      : ‘Not A’;


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: