JavaScript "undefined" keyword not recognized. Null is recognized but not undefined.
Syntax: undefined
Description
undefined is a top-level property and is not associated with any object.
A variable that has not been assigned a value is of type undefined. A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value.
You can use undefined to determine whether a variable has a value. In the following code, the variable x is not defined, and the if statement evaluates to true.
var x
if(x == undefined) {
// these statements execute
}
undefined is also a primitive value.