What will the console.log([] == false) statement output?
a)
true
b)
false
c)
undefined
d)
NaN
Answer:
a)
true
Explanation:
When comparing an empty array []
with false
using the loose equality operator (==
), JavaScript converts the array to a boolean and compares it with false
, resulting in true
.