I am trying to create a dynamic dropdown using javascript and i am unable to loop in through the values returned from the backend application, The object length is returned as 0 even though I have values on it
Below is the object
and This is the javascript snippet
for (key in swaggerlist) {
console.log(key)
if (!swaggerlist.hasOwnProperty(key)) continue;
var obj = swaggerlist[key];
for (var prop in obj) {
if (!obj.hasOwnProperty(prop)) continue;
if(params["url"] == obj[prop]){
option += '<option value="'+ obj[prop] + '" selected>' + obj[prop] + '</option>\n';
} else {
option += '<option value="'+obj[prop] + '">' + obj[prop] + '</option>\n';
}
console.log(obj[prop])
}
}
I am able to read the below one using the above function
How to fix this one and loop in through the object to get the values?