A

Admin • 828.03K Points
Coach

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

Code:
console.log(typeof null);
  • (A) "null"
  • (B) "undefined"
  • (C) "object"
  • (D) "number"
  • Correct Answer - Option(C)
  • Views: 10
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin
In JavaScript, `typeof null` returns "object" due to a long-standing bug in the language. It is technically incorrect, but preserved for backward compatibility.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.