Delete

Delete this post please.

This should give you something to ponder over,

 > console.log("huh?", kek.oof && true)
<- huh? true
 >
1 Like

Have a look at mdn’s documentation for the if-statement

1 Like

you’re checking the Obj type {Object} and comparing it to a type for true a {boolean}. They are obviously different types and will result to false. The " == " operator does typechecking. The “=” does initialization and the “===” does strict type checking.

The if statement is a conditional statement. Hence, there is noting false about with if(Obj){}, It will always resolve to true. It’s just like saying " if this Obj " There is nothing false about that statement, it’ll always resolve to true.

1 Like