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.
If
typeof(undefined) == undefined
, that'd meanundefined
has no type, so it makes sense for the string"undefined"
to be returned instead :D