This is driving me insane. If you don't have a common name for the nested string property, how do you access the information?
example:
var fruitStand = {
'Apples': {
quantity: 1
},
'Pears': {
quantity: 3
}
}
I know this:
console.log(Object.keys(fruitStand)[0]); // "Apples"
How do you get to quantity and 1?
I've tried a variety of options (this, adding all kinds of []s) -I'm sure I'm looking right at it, but can't see it. I also can't seem to find documentation to learn how to access nested objects where the nested object is strings (example: fruitStand.______.quantity //# -what do you put in the ____ to loop? )
End goal is to iterate through a the object, but I can't get past how to access all the parts, so I haven't tried to loop yet.
Thank you in advance!