I have this JSON, I am trying to retrieve values by substituting variables as below.
var model = {
regression : {
regUtils : {
subIDs : {
B00099999823 : {
"a" : "b",
"c" : "d"
}
}
}
};
var vals = "B00099999823";
alert(model.regression.regUtils.subIDs.vals.a); // error returned : Object doesn't support this property or method
alert(model.regression.regUtils.subIDs.B00099999823.a); //alerts b
How can I substitute a variable in place of a key or object. thanks.