Doing twitch.tv json api (intermediate project)

i dont understand where m going wrong…its only a partial code…after showing the online channels…it repeats the RobotCaleb in the array instead of showing all distinct names and their status

var streamers=[“HardlyDifficult”, “ESL_SC2”, “OgamingSC2”, “adobe”, “cretetion”, “freecodecamp”, “storbeck”, “habathcx”, “RobotCaleb”];
var logo="";
var name="";
var status="";
var URL="";
var channel=“https://wind-bow.gomix.me/twitch-api/channels/”;
var streams=“https://wind-bow.gomix.me/twitch-api/streams/”;

for (var i = 0; i < streamers.length; i++) {
var channelURL=channel+streamers[i]+"?callback=?";
var streamsURL=streams+streamers[i]+"?callback=?";
.getJSON(streamsURL,function(data1){ if (data1.stream==null) { .getJSON(channelURL,function(data2){
getOffline(data2);
setData();
});
}
else
{
getOnline(data1);
setData();
}
});
}

function getOnline(on){
logo=on.stream.channel.logo;
name=on.stream.channel.name;
status=on.stream.game;
URL=on.stream.channel.url;
}
function getOffline(off){
logo=off.logo;
name=off.name;
status=“Offline”;
URL=off.url;
}
function setData(){$(".content").append("

"+name+"

"+status+"

");
}

its working now…thanx a lot for helping me 2nd time

btw what is difference b/w “let” and “var”?

Thank you so much sir !

Also, I think this video explains the differences between var, let and const very well:

I found that as a beginner, you are only introduced to var in most coding tutorials, but it seems that it is very useful to know all three of them.

yupp its helpful…thanx