I have ajax nested in the loop. Now I want to merge the ajax returned into an array or a single object. Thanks!
$.each(res.data, function (key, value) {
SerialNumber = value['serial'];
Code = value['code_history'][0]['gift_code'];
return new Promise((resolve, reject)=>{
$.ajax({
type: "POST",
data: "Code=" + Code + "&action=cameraInfo_more" + "&SerialNumber=" + SerialNumber,
url: "ajax/get-customer-info-params",
cache: false,
dataType: "json",
success: function (res_more) {
temp2 = res_more.data[0];
//-- i want merge all json res_more to 1 array
}
})
})
})
}