function to (func) {
try {
var value = typeof func();
return value;
} catch (e) {
return 'undefined';
}
}
console.log(to(()=>g.a));
// your code goes here
ICAgIGZ1bmN0aW9uIHRvIChmdW5jKSB7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgdmFyIHZhbHVlID0gdHlwZW9mIGZ1bmMoKTsKICAgICAgICAgICAgcmV0dXJuIHZhbHVlOwogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgcmV0dXJuICd1bmRlZmluZWQnOwogICAgICAgIH0KICAgIH0KICAgIAogICAgY29uc29sZS5sb2codG8oKCk9PmcuYSkpOwovLyB5b3VyIGNvZGUgZ29lcyBoZXJl