Is there a direct way to deeply nest in a JavaScript object?
In other words: can JavaScript automatically create object parents? In an example where "testObject" is already created… let testObject = {} …this throws an error… testObject.parent.child.grandchild = { foo: ‘ya’ }; This works but is a lot of code… testObject.parent = {}; testObject.parent.child = {}; testObject.parent.child.grandchild = { foo: ‘ya’ }; Things get more complicated… Read More Is there a direct way to deeply nest in a JavaScript object?