This seems rather basic but I am having an impossible time trying to figure this out... How do I access the property value of a property that is in an object within an object?
Ex:
var myObj = {numberOne: {type1: "one", type2:"two"}};
In my case, numberOne is constantly changing as are the property values of the properties within it ("one", "two"). What does not change are the property names themselves (type1, type2). I am looking for a way to access the property value of type1 ("one") as it is the only value I'm interested in working with.
My thought is that I need to create a key for numberOne and use a for... in loop but I'm not pulling up the correct results. I can only get as far as extracting the property names.
var myObj = {numberOne: {type1: "one", type2: "two"}};
var key = Object.keys(myObj)[0];
for (var prop in myObj[key]){
console.log(prop);
}