Как проверить, не определен ли объект в JavaScript
if (typeof something === "undefined") {
alert("something is undefined");
}
Mobile Star
if (typeof something === "undefined") {
alert("something is undefined");
}
if (typeof myFlag !== "undefined") {
// comes here whether myFlag is true or false but not defined
}