I have a unique dictionary structure displayed below. My goal is to populate it with values in a specific way. It all begins here
var animals = {
flying : {},
underground : {},
aquatic : {},
desert : {}
};
To illustrate this process: Let's say I want to insert
d = {dove : [<some list>] }
into animal[flying]
, how would that be accomplished? Since manually entering the values isn't an option and I'm using a loop, I can enter them manually but not programmatically.
I attempted animals[flying] = d
, which worked initially, but when trying to add another value, it replaces rather than appends.
In the end, my desired outcome is something like this: This is what we aim for
var animals = {
flying : {
dove : [<list>],
sparrow : [<list>],
},
underground : {
rabbits : [<list>],
squirrel : [Squirrel],
},
aquatic : {
dolphin : [<list>],
whale : [Squirrel],
},
desert : {
camel : [<list>],
antelope : [<list>],
},
};