JavaScript typeof Interview Question

Опубликовано: 21 Июнь 2026
на канале: Code Talks
8
1

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


На этой странице сайта вы можете посмотреть видео онлайн JavaScript typeof Interview Question длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Code Talks 21 Июнь 2026, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 8 раз и оно понравилось 1 зрителям. Приятного просмотра!