Js uses if to determine why an empty object is true?

Why would an empty object that is not true, enter the if judgment?

Mar.20,2021

null, undefined, NaN, + 0,-0, ". These six Boolean types are converted to false, and the rest are true


if (a)
equivalent to
if ((Boolean) a)


=. You should use


  equality judgment in JavaScript  

Menu