Hacker News new | past | comments | ask | show | jobs | submit login

To quickly cooerse to a boolean:

    !!0 === false; !!"zipzap" === true; !!NaN === false
To cooerse to a integer (not float):

    ~~0.5 === 0; ~~"12zipzap" === 0; ~~(Math.PI) === 3;
I tend to avoid it for readability (for other developers)



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

Search: