I am looping over an array and calling different urls based on the array value. I extract certain results and later need to sort them before I present them on the page. I think I need a Promise. How do I implement it in this case?
$.each(...{//looping over array
$.get(...{//calling different urls based on array value
$.each(...{
extracted_data = ...//extract certain results
})
})
})
//This needs to happen after ALL the $.get calls are completed
extracted_data.sort()
present()