I have a JSON object and I am iterating through it. I am using different values from different levels of it.
But I am not able to create path dynamically to reiterate the object.
var data= {
"algoName": "textClassification",
"hyperParams": {
"mode": {
"data_type": "string",
"default_value": "supervised",
"required": true,
"description": "The training mode",
"allowedValues": [
"supervised",
"unsupervised"
]
}
}
}
var key1;
for(var key in data.hyperParams) {
key1=key;
}
var text1 = "data.hyperParams" + key1
for(var key in text1) {
console.log(text1[key]);
}