I am trying to grab a bunch of data in a for statement, push it to an object array and then extract it ? i.e.
var d = {
city: [{
region: '',
name: '',
type: ''
}]
}
I am getting data from cityList[i] – which has around 10 of each – like
for(var i=0, city; i < cityList.len; i++ {
city = cityList[i]
//manipulate a bit
d.city.push(data, data1, data2) //i.e. region, name, type
}
Then I want to show that data from d.city ? How can I do that
Set data to array shold look:
To retrieve data from
d.cityyou can use: