JSFiddle - React, Tailwind, and code Playground

by mpalmerlee

JavaScript

var channelNames = [];
var channelIds = [ 'UCI9gIf0scF8jeXziFyXG-Zw' ];


channelIds.forEach(function(channelId){
    
    $.get('http://gdata.youtube.com/feeds/api/users/' + channelId + '?alt=json&fields=yt:username&key=AIzaSyBE2Pt7xnKN3mv_X-xdTvLFbQDsto3L5OY')
    .always(function (res) {
       
        channelNames.push(res.entry["yt$username"]["$t"]);
    });
});

console.log(channelNames);