Many beginners get confused because typeof "Hello" prints string without quotes.
But remember, typeof always returns a string value.
The console simply hides the quotation marks when displaying strings.
console.log(typeof "Hello"); // string
console.log(typeof 100); // number
console.log(typeof true); // boolean
console.log(typeof undefined); // undefined
The typeof operator tells us the data type of a value.
typeof "Hello" returns "string".
typeof 100 returns "number".
typeof true returns "boolean".
typeof undefined returns "undefined".
But here's the JavaScript interview question:
console.log(typeof null);
The output is "object".
This is actually a historical bug in JavaScript that has been kept for backward compatibility.
#javascript #js #webdevelopment #frontend #coding #programming #developer #interviewquestions
On this page of the site you can watch the video online JavaScript typeof Interview Question with a duration of hours minute second in good quality, which was uploaded by the user Code Talks 21 June 2026, share the link with friends and acquaintances, this video has already been watched 8 times on youtube and it was liked by 1 viewers. Enjoy your viewing!