I'm very new at Javascript. I had some issue going on with my script I had to loop through $.get and I stuck in a loop here is my code
a = ["{"sid":"13485"}","{"sid":"25114"}","{"sid":"45145"}"]
for (var i = 0; i < a.length; i+=1){
.$get('url' + "?params=" + a[i],function(data2){
school = data2['data'];
});
}
console.log(school);
When I tried to console.log(school) it keeps showing "object{}"
How can I get the data outside loop?
I would be really grateful if you can help me with this issue.
Thanks.