I have a method in Javascript/jQuery that takes two arguments:
makeTwoChart(arrOne, arrTwo)
I am trying to call two API endpints together and pass their response in this method.
both API endpoints are returning arrays of the same length in response.
let arrOne = [];
let arrTwo = [];
$.get(`${API_URL}tour/month-wise-product/`, function(data, status) {
arrOne=data.results
});
$.get(`${API_URL}tour/month-wise-sell/`, function(data, status) {
arrTwo=data.results
});
makeTwoChart(arrOne, arrTwo)
I am not getting what to do in this situation, Can anyone help me in this situation? How to send two response in method at the same you get a response
Can anyone help me in this case?