How can I avoid such long if conditions?
if (typeof window.checkoutConfig.shipping !== "undefined") {
if (typeof window.checkoutConfig.shipping.rules !== "undefined") {
if (typeof window.checkoutConfig.shipping.rules.express !== "undefined") {
if (typeof window.checkoutConfig.shipping.rules.express.express_note !== "undefined") {
this.expressNote(window.checkoutConfig.shipping.rules.express.express_note || "");
}
}
}
}
Is there a method which I can use instead, for example (pseudo code): isset(window.checkoutConfig.shipping.rules.express.express_note)
.