I have a dictionary as follows:
var manifest = {
"product": "onetouch",
"routes": [
{
"title": "Meters and Monitoring",
"manifest": "metersAndMonitoring"
}
]
}
The value for the manifest key is actually another variable that holds another dictionary, as so:
var metersAndMonitoring = {
"question" : "How can we help your patients with blood glucose monitoring?",
"matrix" : [
{
"fileURL" : "slides/3.1_meters_and_monitoring/meters_and_monitoring.html",
"cssURL" : "slides/3.1_meters_and_monitoring/css/meters_and_monitoring.css",
"title" : "Meters and Monitoring",
"thumbnail" : "slides/3.1_meters_and_monitoring/thumbnail.jpg"
}
]
}
When I access manifest.routes[0].manifest I get the value "metersAndMonitoring" as I should. However, what I want is then to be able to console.log(metersAndMonitoring)
and get the output of the dictionary I assigned to that variable. All I currently get is the key as a string.
So my question is, how can I access the key in the first dictionary, and use it as the variable of the same string that I have used for the second dictionary?