let foo = { someFooProp: "hi" }; console.log(foo.someFooProp?.toUpperCase() ?? "not available"); // "HI" console.log(foo.someBarProp?.toUpperCase() ?? "not available"); // "not available"