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

Why not do:

const y = x ? true : false;



I'm talking about cases with additional logic that's too long for a ternary.


That sounds like a more complicated way to write

    const y = (bool)x;
or

    const bool y = x;




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

Search: