What is the output of the following code: console.log([] == false);?
a)
trueb)
falsec)
undefinedd)
NaNAnswer:
a)
trueExplanation:
In JavaScript, an empty array [] is loosely equal (==) to false due to type coercion. When using ==, both operands are converted to the same type before comparison, resulting in true for [] == false.