JavaScript Interview Question #40: What is the type of `undefined` in JS?
Coderslang: Become a Software Engineer
Posted on May 13, 2021
What's the output?
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
In JavaScript, the typeof
operator always returns a string.
So, even though typeof undefined
evaluates to undefined
, it’s a string and not the primitive undefined
value.
The string ’undefined’
is not equal to the value undefined
.
ANSWER: the message false
will appear in the console.
💖 💪 🙅 🚩
Coderslang: Become a Software Engineer
Posted on May 13, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.