DEV Community

Discussion on: 2 Ways to Convert Values to Boolean in JavaScript

Collapse
 
samanthaming profile image
Samantha Ming • Edited

May I add something, if you don't mind 😊

something ? /* if truthy */ : /* if falsy */

Because doing something like this something will capture all truthy/falsy value and not just true/false. I've made that mistake in past, so I just want to include this friendly reminder to be mindful of πŸ‘

Collapse
 
mzaini30 profile image
Zen

Oh thanks πŸ˜‚

Collapse
 
mzaini30 profile image
Zen

I just found out that truth / falsy is different from true / false. Very cool, Javascript