function isUndefined(obj) { return typeof(obj) === "undefined" || obj == null; }; var Obj1; alert( isUndefined(Obj1) );