Is there a simpler way than using ___ in object to check the existence of each level of an object to check the existence of a single member?
___ in object
More conci
You could also try/catch TypeError?
try { console.log(someObject.member.member.member.value); } catch(e) { if (e instanceof TypeError) { console.log("Couldn't access someObject.member.member.member.value"); console.log(someObject); } }