!undefined
is true in javascript, so if you want to know whether your variable or object is undefined and want to take actions, you could do something like this:
if(<object or variable>) {
//take actions if object is not undefined
} else {
//take actions if object is undefined
}