So überprüfen Sie, ob das Objekt in JavaScript undefiniert ist
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
}