There are two things here: the "value" undefined, which is a value that a variable can point to when it has been declared but not assigned anything yet (i.e. var a;), or when it's been assigned something that doesn't actually have a value or exists, and there is the string "undefined", which is a string similar to "monkey" or "collywobble".
In your conditional, you're testing to see what the result of the typeof operator is, which is a string "object" or "function", or in this case "undefined". Those are just words:
if(typeof a == "undefined")
is the same as testing
if(a == undefined)
So, when you console.log the actual object, you'll see it has a value undefined, rather than being a string "undefined".