Single Choice
Not Set
QWhat is the result of the following code?
let x = null;
console.log(typeof x);
ID: #4858
Basic JavaScript MCQ
301 views
Question Info
#4858Q ID
Not SetDifficulty
Basic JavaScript MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
The result of the code is 'object'.
In JavaScript, the typeof operator returns a string that represents the type of a value.
However, the typeof operator has a few quirks,
one of which is that it returns 'object' for null values.
This is a known issue in JavaScript, and it can cause confusion for developers who are not aware
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic