I need to know that how could i extract data if i have response like this
Object {cast: Object}
cast: Array[5]
0: Object
text: "Select Any"
value: "000"
__proto__: Object
1: Object
2: Object
3: Object
4: Object
Same this pattern in remaining Object
Update 1
I have array like this
var response = {};
response = showData();
and when i console.log(response)
then in my console the above mention output will display
and when i tried response.length
it shows me undefined
Update 2
function showData(){
var foodSubCatagories1 = {};
foodSubCatagories1.cast = _context.FoodGroup.forEach(function(FG)
{
$('#selectCatagoryFood').append('<option value="'+FG.FoodGroupID+'">'+FG.Description+'</option>');
}).then(function(){
$('#selectCatagoryFood').selectmenu('refresh');
foodSubCatagories1.cast = [
{
value: "000",
text: "Select Any"
},
{
value: "1",
text: "Juice"
},
{
value: "2",
text: "Dairy"
},
{
value: "3",
text: "Farm"
},
{
value: "4",
text: "Custom"
}
];
return foodSubCatagories1.cast;
});
return foodSubCatagories1;
}