Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

How to loop through an array and parse with $.getJSON? (if possible)

Hi, I have a link to my codepen I've been working in: http://codepen.io/xGabey/pen/BpBVZw?editors=0010 and as you can see, I have an array called 'streamers' with 3 streamers inside. Then, I have a variable 'proxy' which stores a sort of API in it for Twitch. (I heard it was a proxy so people wouldn't have to use the old API.) So my problem is, inside proxy, the very last item stores a channel name. But currently, the channel name I put in it is the second, streamers[1], in the array. I've been trying to get it so that the last item in the getJSON request, instead of being one strict channel, cycles through all items in my array and loops through and prints out each one accordingly, online/offline. The twitch dev blog was very confusing to me, as it seems they've updated their api structure multiple times, where now, a client id is not needed if using gomix.me. Super long question, but thanks to anyone in advance! G