DEV Community

Discussion on: JavaScript == VS === The truth

jhynzar profile image
Mj Tapiru

Just to add, if you really have to check for a Truthy value, and still want to compare it to true

you can do it like this:

if (Boolean(x) === true) {

P.S. in this case you can use Loose Comparison(==) or Strict Comparison(===). ^