var objeto = {
sub1_A: {},
sub1_B: {},
sub1_C: {}
}
I have no problems if I do the following:
objeto.sub1_A.sub2 = "Prueba";
But yes if I descend a level more directly:
objeto.sub1_A.sub2.sub3 = "Prueba";
If I try to set the above, it says "Uncaught TypeError: Can not set property 'recodes' of undefined." I understand that it is because you can set / define a method or property of an existing object but not one that does not.
Is not there a way to go down as many levels as you want by creating that "way"?
If I wanted to create something like object.sub1.sub2.sub3.sub4.sub5="SetealoYa!" Am I forced to go step by step? I am convinced that there must be another method.
Thank you very much in advance!