var channels = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
function getChannelInfo() {
channels.forEach(function(channel) {
console.log("outside");
$.getJSON("https://wind-bow.glitch.me/twitch-api/streams/cretetion?callback=", function(data) {
console.log("inside");
});
});
};
$(document).ready(function() {
getChannelInfo();
})
In this code, the console.log in the getJSON method does not run until after the forEach loop has ended. I thought that the getJSON method would run simultaneously to everything else.