I have a javascript object;
xml
-nutrition
--daily values
--food
---0
----fat=20g
----sodium=
---1
----fat=20g
----sodium=5mg
---2
----fat=20g
----sodium=5mg
-stores
--0
--1
I also have a dynamically generated javascript array
["xml", "nutrition", "food", 0]
How can I update the javascript object based on this array? without typing it manually
myobj[array[0]][array[1]][array[2]][array[3]].fat = '30g';