Let's say I have a complex object with properties that have properties.
var x = {};
x.A.B = 'Hello';
x.A.C = 'World!';
x.D.E = 100;
x.D.F = 2.5;
Is there anything I could put in a single set of square brackets in order to get back any of these properties? A simple test shows that x['A.B'] does not return 'Hello'. Is there any syntax for doing this?
deepProperyExists('a.b.c', obj)Just iterate over the number of periods and checking if the property is undefined each iteration. (a, a.b, a.b.c)