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

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