add one if not set javascirpt code example Example: js if not undefined if (typeof myVar !== "undefined") { console.log("myVar is DEFINED"); }