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?
More conci
If you can use lodash
library, it has a very elegant solution, hasIn.
_.hasIn(someObject, 'member.level1.level2.level3');
for example,
var obj = {'x': 999, 'a': {'b': {'c': 123, 'd': 234}}}
// => undefined
_.hasIn(obj, 'x')
// => true
_.hasIn(obj, 'a.b.d')
// => true
_.hasIn(obj, 'a.b.e')
// => false