Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getOnlineGamers(){
- var online_gamers = [];
- for (var i=0; i<gamers.length; i++){
- //(gamers is a defined array with 11names of 11gamers.)
- $.getJSON(url+"streams/"+ gamers[i]+cid).done(function(data){
- if(data.stream === null){
- }else {
- var name= data.stream.channel.name;
- online_gamers.push(name);
- }
- console.log(online_gamers); // <--- A
- });
- };
- console.log(online_gamers); //<--- B
- };
- console.log(getOnlineGamers())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement