Q. What will be the output of the code below?

Code:
let a;
console.log(a === undefined);
  • (A) true
  • (B) false
  • (C) null
  • (D) ReferenceError
πŸ’¬ Discuss
βœ… Correct Answer: (A) true
Explanation: A variable declared but not initialized is `undefined` in JavaScript. Therefore, the comparison `a === undefined` returns `true`.
Explanation by: Mr. Dubey
A variable declared but not initialized is `undefined` in JavaScript. Therefore, the comparison `a === undefined` returns `true`.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
120
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
91%
Success Rate