Hi Experts
Sorry i dont know how to construct my question. My goal is i want to get all of the length from an array and here's my code
personEmails.forEach(function(test){
var b = test.IncidentId;
var $sentEmails= cbs.CaseDocuments.getSentEmails(personId, b);
$.when($sentEmails).then(function (sentEmails) {
test = sentEmails.length;
return test++;
});
});
on my "personEmails" there are two value and i get the incidentId to get the list of sent emails, on the first loop and goes to the getPersonEmails the "length is two" and on the second loop it get only one value/length and the result is 2 instead of 3, because on the first loop the 2 value/length it counts only as one on the return test.
Do you have any idea about this? i really need you help and im not good on Javascript thanks in advance
*This post is locked for comments