Q. What will be the output of the following JavaScript code?

Code:
console.log(typeof null);
  • (A) "null"
  • (B) "undefined"
  • (C) "object"
  • (D) "number"
πŸ’¬ Discuss
βœ… Correct Answer: (C) "object"
Explanation: In JavaScript, `typeof null` returns "object" due to a long-standing bug in the language. It is technically incorrect, but preserved for backward compatibility.
Explanation by: Mr. Dubey
In JavaScript, `typeof null` returns "object" due to a long-standing bug in the language. It is technically incorrect, but preserved for backward compatibility.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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