javascript test for existence of nested object key
javascript test for existence of nested object key
If I have a reference to an object –
var test = {};
that will potentially (but not immediately) have nested objects, something like –
{ level1:{level2:{level3:'level3'}} };
what is the best way to test for the existence of keys in the most deeply nested objects?
This –
alert(test.level1);
returns ‘undefined’, but this –
alert(test.level1.level2.level3);
fails.
I’m currently doing…
View On WordPress








