var g = {};
console.log(g);
console.log(g.a);
function t(func, fallbackValue) {
try {
var value = func();
return (value === null || value === undefined) ? fallbackValue : value;
} catch (e) {
return fallbackValue;
}
}
console.log(t(() => g.a.b), 'null');
dmFyIGcgPSB7fTsKCmNvbnNvbGUubG9nKGcpOwpjb25zb2xlLmxvZyhnLmEpOwoKZnVuY3Rpb24gdChmdW5jLCBmYWxsYmFja1ZhbHVlKSB7CiAgICB0cnkgewogICAgICAgIHZhciB2YWx1ZSA9IGZ1bmMoKTsKICAgICAgICByZXR1cm4gKHZhbHVlID09PSBudWxsIHx8IHZhbHVlID09PSB1bmRlZmluZWQpID8gZmFsbGJhY2tWYWx1ZSA6IHZhbHVlOwogICAgfSBjYXRjaCAoZSkgewogICAgICAgIHJldHVybiBmYWxsYmFja1ZhbHVlOwogICAgfQp9Cgpjb25zb2xlLmxvZyh0KCgpID0+IGcuYS5iKSwgJ251bGwnKTs=