What will the console.log(null == undefined) statement output?

What will the console.log(null == undefined) statement output?

a) true
b) false
c) undefined
d) NaN

Answer:

a) true

Explanation:

In JavaScript, null and undefined are loosely equal (==), meaning they are treated as the same value in non-strict comparison, so null == undefined returns true.

However, they are not strictly equal (===), as their types are different.

Reference:

JavaScript MCQ (Multiple-Choice Questions)

Scroll to Top