This is my code ,
$.each(result, function (index, value) {
  if (value.name != null) {                       
    $.ajax({
      // myApi call code
    });
  }
  // I only want reach here after api call finish
  if (value.flag) {}
});
There are two condition inside loop , one is checking name != null and api call inside , the next is value.flag . I just want to reach to second condition after api call complete .
 
     
     
     
     
    