Twitch.tv project (feedback)

Hello,

I just completed the Twitch TV Project.

Project Link - https://codepen.io/X140hu4/full/KyaZvX/

I had a lot of trouble to make it work… but it was interesting to work with multiple requests firing at the same time. I am going to look at other people’s code now in order to see how they overcame this.

So far in my projects I have avoided using jquery or any framework.

I wondered if there was a better way in pure JS to dynamically create nodes?

Thanks for taking the time to look at my code and give feedback :wink:

Hi @camperextraordinaire!

Thank you very much for reviewing my code.

Deleting the displayArrow(n) does not work. The purpose is to show the arrow below the buttons [All], [Online] and [Offline], so if you take them out, run and click on Online or Offline, the arrow remains under “All”.

I have added the following function:

function displayIt(onDisplay, offDisplay) {
  for(var i = 0, n = stream_on.length; i < n; i++) {
    stream_on[i].style.display = onDisplay;
  }
  for(var i = 0, n = stream_off.length; i < n; i++) {
    stream_off[i].style.display = offDisplay;
  }
}

Oh perfect! I wanted to use a differ for syntax but couldn’t make it work before :slight_smile: Thank you very much!