dimanche 9 décembre 2018

How i change array in js get by key

I have data return form controller

foo:0: 
{id: 1, add_1: "123", add_2: "add1", district_id: 8861, amphur_id: 45, province_id: 1,…} 
1: {id: 2, add_1: "456", add_2: "add2", district_id: 8861, amphur_id: 45, province_id: 1,…}

How can I change the key to like this

foo:
id:{1,2}
add_1:{123,456}
add_2:{add1,add2}
....

I'm try use .map not change like this



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire