My codepen for this project: https://codepen.io/juan-coding/pen/NyKGPe?editors=0001
My code generally works, but I can tell there are some “ugly” code. One of the problems is that:
in order to display all the channels by default, I do the following:
If I place
in line 44, it works fine; but if place in line 30, not workable. (
console.log(html_all) output as “”).
I thought, after the
for loop, global variable
html_all's value will be updated to a list of data for the Twitch channels, but why (
console.log(html_all) output as “”, empty. ( run in line 30)?
button_click function is workable, in which
html_all is involved?
Hopefully, someone could clarify these for me! Many thanks in advance.